commit 87050d5baa5982cad005ad781c6c54ec70c0a400
parent 27784f804ece302937042a480c037414669d433e
Author: Hiroyuki Ikezoe <hikezoe.birchill@mozilla.com>
Date: Mon, 10 Nov 2025 22:15:31 +0000
Bug 1996718 - Check whether BrowserChild has not yet been destroyed in each function of ContentProcessController. r=botond
Differential Revision: https://phabricator.services.mozilla.com/D270278
Diffstat:
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/gfx/layers/apz/util/ContentProcessController.cpp b/gfx/layers/apz/util/ContentProcessController.cpp
@@ -32,7 +32,7 @@ void ContentProcessController::NotifyLayerTransforms(
void ContentProcessController::RequestContentRepaint(
const RepaintRequest& aRequest) {
- if (mBrowser) {
+ if (mBrowser && !mBrowser->IsDestroyed()) {
mBrowser->UpdateFrame(aRequest);
}
}
@@ -56,7 +56,7 @@ void ContentProcessController::NotifyPinchGesture(
void ContentProcessController::NotifyAPZStateChange(
const ScrollableLayerGuid& aGuid, APZStateChange aChange, int aArg,
Maybe<uint64_t> aInputBlockId) {
- if (mBrowser) {
+ if (mBrowser && !mBrowser->IsDestroyed()) {
mBrowser->NotifyAPZStateChange(aGuid.mScrollId, aChange, aArg,
aInputBlockId);
}
@@ -64,13 +64,13 @@ void ContentProcessController::NotifyAPZStateChange(
void ContentProcessController::NotifyMozMouseScrollEvent(
const ScrollableLayerGuid::ViewID& aScrollId, const nsString& aEvent) {
- if (mBrowser) {
+ if (mBrowser && !mBrowser->IsDestroyed()) {
APZCCallbackHelper::NotifyMozMouseScrollEvent(aScrollId, aEvent);
}
}
void ContentProcessController::NotifyFlushComplete() {
- if (mBrowser) {
+ if (mBrowser && !mBrowser->IsDestroyed()) {
RefPtr<PresShell> presShell = mBrowser->GetTopLevelPresShell();
APZCCallbackHelper::NotifyFlushComplete(presShell);
}
@@ -113,7 +113,7 @@ void ContentProcessController::DispatchToRepaintThread(
}
PresShell* ContentProcessController::GetTopLevelPresShell() const {
- if (!mBrowser) {
+ if (!mBrowser || mBrowser->IsDestroyed()) {
return nullptr;
}
return mBrowser->GetTopLevelPresShell();