Bug 1409594 - Check if root WebRenderBridgeParent exists r=kats

This commit is contained in:
sotaro 2017-10-19 11:15:46 +09:00
Родитель 359def9977
Коммит e7235d5225
1 изменённых файлов: 5 добавлений и 2 удалений

Просмотреть файл

@ -212,8 +212,12 @@ CrossProcessCompositorBridgeParent::AllocPWebRenderBridgeParent(const wr::Pipeli
MOZ_ASSERT(sIndirectLayerTrees.find(layersId) != sIndirectLayerTrees.end());
MOZ_ASSERT(sIndirectLayerTrees[layersId].mWrBridge == nullptr);
WebRenderBridgeParent* parent = nullptr;
WebRenderBridgeParent* root = nullptr;
CompositorBridgeParent* cbp = sIndirectLayerTrees[layersId].mParent;
if (!cbp) {
if (cbp) {
root = sIndirectLayerTrees[cbp->RootLayerTreeId()].mWrBridge.get();
}
if (!root) {
// This could happen when this function is called after CompositorBridgeParent destruction.
// This was observed during Tab move between different windows.
NS_WARNING("Created child without a matching parent?");
@ -223,7 +227,6 @@ CrossProcessCompositorBridgeParent::AllocPWebRenderBridgeParent(const wr::Pipeli
*aTextureFactoryIdentifier = TextureFactoryIdentifier(LayersBackend::LAYERS_NONE);
return parent;
}
WebRenderBridgeParent* root = sIndirectLayerTrees[cbp->RootLayerTreeId()].mWrBridge.get();
RefPtr<wr::WebRenderAPI> api = root->GetWebRenderAPI()->Clone();
RefPtr<AsyncImagePipelineManager> holder = root->AsyncImageManager();