Bug 1322633 - Don't initialize APZ protocols unless PLayerTransaction was successfully set up. r=dvander a=gchang
authorKartikaya Gupta <kgupta@mozilla.com>
Mon, 30 Jan 2017 10:05:43 -0500
changeset 378138 1634b7d9ef87d35a6eca538aec8fe1aaeeea3155
parent 378137 7ed6eee40e2995d597a912b8a7bf3f3459756d33
child 378139 c9c4eb9fbaeb590303564a2ec990ef3130367b23
push id1419
push userjlund@mozilla.com
push dateMon, 10 Apr 2017 20:44:07 +0000
treeherdermozilla-release@5e6801b73ef6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdvander, gchang
bugs1322633
milestone53.0a2
Bug 1322633 - Don't initialize APZ protocols unless PLayerTransaction was successfully set up. r=dvander a=gchang MozReview-Commit-ID: Ja8TsCeGZ9
dom/ipc/TabChild.cpp
--- a/dom/ipc/TabChild.cpp
+++ b/dom/ipc/TabChild.cpp
@@ -2576,16 +2576,26 @@ TabChild::InitRenderingState(const Textu
       NS_WARNING("failed to get CompositorBridgeChild instance");
       return;
     }
 
     CompositorOptions options;
     Unused << compositorChild->SendGetCompositorOptions(aLayersId, &options);
     mCompositorOptions = Some(options);
 
+    mRemoteFrame = static_cast<RenderFrameChild*>(aRenderFrame);
+    if (aLayersId != 0) {
+      if (!sTabChildren) {
+        sTabChildren = new TabChildMap;
+      }
+      MOZ_ASSERT(!sTabChildren->Get(aLayersId));
+      sTabChildren->Put(aLayersId, this);
+      mLayersId = aLayersId;
+    }
+
     ShadowLayerForwarder* lf =
         mPuppetWidget->GetLayerManager(
             nullptr, mTextureFactoryIdentifier.mParentBackend)
                 ->AsShadowForwarder();
     // As long as we are creating a ClientLayerManager for the puppet widget,
     // lf must be non-null here.
     MOZ_ASSERT(lf);
 
@@ -2596,31 +2606,20 @@ TabChild::InitRenderingState(const Textu
       PLayerTransactionChild* shadowManager =
           compositorChild->SendPLayerTransactionConstructor(backends,
                                                             aLayersId, &mTextureFactoryIdentifier, &success);
       if (shadowManager && success) {
         lf->SetShadowManager(shadowManager);
         lf->IdentifyTextureHost(mTextureFactoryIdentifier);
         ImageBridgeChild::IdentifyCompositorTextureHost(mTextureFactoryIdentifier);
         gfx::VRManagerChild::IdentifyTextureHost(mTextureFactoryIdentifier);
+        InitAPZState();
       }
     }
 
-    mRemoteFrame = static_cast<RenderFrameChild*>(aRenderFrame);
-    if (aLayersId != 0) {
-      if (!sTabChildren) {
-        sTabChildren = new TabChildMap;
-      }
-      MOZ_ASSERT(!sTabChildren->Get(aLayersId));
-      sTabChildren->Put(aLayersId, this);
-      mLayersId = aLayersId;
-    }
-
-    InitAPZState();
-
     nsCOMPtr<nsIObserverService> observerService =
         mozilla::services::GetObserverService();
 
     if (observerService) {
         observerService->AddObserver(this,
                                      BEFORE_FIRST_PAINT,
                                      false);
     }