Bug 968001 - In OpSetRoot, check that the new root is a root - r=nical
authorBenoit Jacob <bjacob@mozilla.com>
Thu, 20 Feb 2014 15:05:08 -0500
changeset 169738 017de48b754f5f82a2be4b56c6a4c1cb3975d9ee
parent 169737 2ea5f9a5272ebd6c083fa2935c95dc483e925aa7
child 169739 3bfe9190b72d40b956bd99600ea3d940d843b8db
push id40043
push userbjacob@mozilla.com
push dateThu, 20 Feb 2014 20:22:06 +0000
treeherdermozilla-inbound@11e06d77e4f9 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersnical
bugs968001
milestone30.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 968001 - In OpSetRoot, check that the new root is a root - r=nical
gfx/layers/ipc/LayerTransactionParent.cpp
--- a/gfx/layers/ipc/LayerTransactionParent.cpp
+++ b/gfx/layers/ipc/LayerTransactionParent.cpp
@@ -385,17 +385,21 @@ LayerTransactionParent::RecvUpdate(const
       mLayerManager->GetCompositor()->SetDiagnosticTypes(
         edit.get_OpSetDiagnosticTypes().diagnostics());
       break;
     }
     // Tree ops
     case Edit::TOpSetRoot: {
       MOZ_LAYERS_LOG(("[ParentSide] SetRoot"));
 
-      mRoot = AsLayerComposite(edit.get_OpSetRoot())->AsLayer();
+      Layer* newRoot = AsLayerComposite(edit.get_OpSetRoot())->AsLayer();
+      if (newRoot->GetParent()) {
+        return false;
+      }
+      mRoot = newRoot;
       break;
     }
     case Edit::TOpInsertAfter: {
       MOZ_LAYERS_LOG(("[ParentSide] InsertAfter"));
 
       const OpInsertAfter& oia = edit.get_OpInsertAfter();
       ShadowContainer(oia)->AsContainerLayerComposite()->InsertAfter(
         ShadowChild(oia)->AsLayer(), ShadowAfter(oia)->AsLayer());