mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-03-01 22:07:41 +00:00
Bug 1134252 - Don't crash the content process if RenderFrameParent is not constructed successfully. r=billm.
We were returning a nullptr from AllocPRenderFrameParent in TabParent, which causes a killhard abort in the child. We suspect this is occurring because the TabParent is attempting to kick off drawing in a tab that's already closed (so there is no frame loader, which means we can't create a PRenderFrameParent). So now, we return a PRenderFrameParent* even if constructing it was unsuccessful, and the child destroys it once it confirms that there is an invalid layer ID associated with the RenderFrame. --HG-- extra : commitid : K7IDcpprjxI extra : rebase_source : 9994cbe9a9a2a6216d189ccfe99a440f4db7b871
This commit is contained in:
parent
723cbf3c16
commit
161ac0ee7a
@ -2626,18 +2626,16 @@ TabParent::AllocPRenderFrameParent()
|
||||
TextureFactoryIdentifier textureFactoryIdentifier;
|
||||
uint64_t layersId = 0;
|
||||
bool success = false;
|
||||
if(frameLoader) {
|
||||
PRenderFrameParent* renderFrame =
|
||||
new RenderFrameParent(frameLoader,
|
||||
&textureFactoryIdentifier,
|
||||
&layersId,
|
||||
&success);
|
||||
MOZ_ASSERT(success);
|
||||
|
||||
PRenderFrameParent* renderFrame =
|
||||
new RenderFrameParent(frameLoader,
|
||||
&textureFactoryIdentifier,
|
||||
&layersId,
|
||||
&success);
|
||||
if (success) {
|
||||
AddTabParentToTable(layersId, this);
|
||||
return renderFrame;
|
||||
} else {
|
||||
return nullptr;
|
||||
}
|
||||
return renderFrame;
|
||||
}
|
||||
|
||||
bool
|
||||
|
@ -293,13 +293,12 @@ RenderFrameParent::RenderFrameParent(nsFrameLoader* aFrameLoader,
|
||||
, mBackgroundColor(gfxRGBA(1, 1, 1))
|
||||
, mAsyncPanZoomEnabled(false)
|
||||
{
|
||||
*aId = 0;
|
||||
*aSuccess = false;
|
||||
if (!mFrameLoader) {
|
||||
return;
|
||||
}
|
||||
|
||||
*aId = 0;
|
||||
|
||||
nsRefPtr<LayerManager> lm = GetFrom(mFrameLoader);
|
||||
|
||||
mAsyncPanZoomEnabled = lm && lm->AsyncPanZoomEnabled();
|
||||
|
Loading…
x
Reference in New Issue
Block a user