Bug 997367 - fix crash at CrossProcessCompositorParent::GetCompositionManager. r=roc
☠☠ backed out by 3dcee82b43f4 ☠ ☠
authorPeter Chang <pchang@mozilla.com>
Tue, 22 Apr 2014 19:07:00 +0200
changeset 199489 87f6ee3f86c1d39423145d65a18524477de0f534
parent 199488 c223611fa19ec5a591aa0f22b1b5df4f0c712d94
child 199490 354e438548fba15db48e9a8ff523cff884b937d2
push id486
push userasasaki@mozilla.com
push dateMon, 14 Jul 2014 18:39:42 +0000
treeherdermozilla-release@d33428174ff1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersroc
bugs997367
milestone31.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 997367 - fix crash at CrossProcessCompositorParent::GetCompositionManager. r=roc
gfx/layers/ipc/CompositorParent.cpp
gfx/layers/ipc/CompositorParent.h
layout/ipc/RenderFrameParent.cpp
--- a/gfx/layers/ipc/CompositorParent.cpp
+++ b/gfx/layers/ipc/CompositorParent.cpp
@@ -974,29 +974,21 @@ CompositorParent::AllocateLayerTreeId()
 {
   MOZ_ASSERT(CompositorLoop());
   MOZ_ASSERT(NS_IsMainThread());
   static uint64_t ids = 0;
   return ++ids;
 }
 
 static void
-EraseLayerState(uint64_t aId)
+RemoveIndirectTree(uint64_t aId)
 {
   sIndirectLayerTrees.erase(aId);
 }
 
-/*static*/ void
-CompositorParent::DeallocateLayerTreeId(uint64_t aId)
-{
-  MOZ_ASSERT(NS_IsMainThread());
-  CompositorLoop()->PostTask(FROM_HERE,
-                             NewRunnableFunction(&EraseLayerState, aId));
-}
-
 static void
 UpdateControllerForLayersId(uint64_t aLayersId,
                             GeckoContentController* aController)
 {
   // Adopt ref given to us by SetControllerForLayerTree()
   sIndirectLayerTrees[aLayersId].mController =
     already_AddRefed<GeckoContentController>(aController);
 }
@@ -1180,22 +1172,16 @@ CompositorParent::GetIndirectShadowTree(
 {
   LayerTreeMap::const_iterator cit = sIndirectLayerTrees.find(aId);
   if (sIndirectLayerTrees.end() == cit) {
     return nullptr;
   }
   return &cit->second;
 }
 
-static void
-RemoveIndirectTree(uint64_t aId)
-{
-  sIndirectLayerTrees.erase(aId);
-}
-
 void
 CrossProcessCompositorParent::ActorDestroy(ActorDestroyReason aWhy)
 {
   MessageLoop::current()->PostTask(
     FROM_HERE,
     NewRunnableMethod(this, &CrossProcessCompositorParent::DeferredDestroy));
 }
 
--- a/gfx/layers/ipc/CompositorParent.h
+++ b/gfx/layers/ipc/CompositorParent.h
@@ -159,22 +159,16 @@ public:
 
   /**
    * Allocate an ID that can be used to refer to a layer tree and
    * associated resources that live only on the compositor thread.
    *
    * Must run on the content main thread.
    */
   static uint64_t AllocateLayerTreeId();
-  /**
-   * Release compositor-thread resources referred to by |aID|.
-   *
-   * Must run on the content main thread.
-   */
-  static void DeallocateLayerTreeId(uint64_t aId);
 
   /**
    * Set aController as the pan/zoom callback for the subtree referred
    * to by aLayersId.
    *
    * Must run on content main thread.
    */
   static void SetControllerForLayerTree(uint64_t aLayersId,
--- a/layout/ipc/RenderFrameParent.cpp
+++ b/layout/ipc/RenderFrameParent.cpp
@@ -937,17 +937,16 @@ RenderFrameParent::NotifyInputEvent(Widg
     GetApzcTreeManager()->ReceiveInputEvent(aEvent, aOutTargetGuid);
   }
 }
 
 void
 RenderFrameParent::ActorDestroy(ActorDestroyReason why)
 {
   if (mLayersId != 0) {
-    CompositorParent::DeallocateLayerTreeId(mLayersId);
     if (mContentController) {
       // Stop our content controller from requesting repaints of our
       // content.
       mContentController->ClearRenderFrame();
       // TODO: notify the compositor?
     }
   }