Bug 1226920 - For instances of ForEachNode where we want to traverse the entire tree, use an action that returns void. r=botond
authorKevin Wern <kevin.m.wern@gmail.com>
Mon, 23 Nov 2015 13:06:29 -0500
changeset 273876 18a0a55c668d781d45dbc96b9eda68cc9a5b207e
parent 273875 6dcbb6dd88dc7e6223e85b90b8612274a9eee334
child 273877 e7f29a360692e2e4187005068b8a154217ec21bf
push id29715
push userkwierso@gmail.com
push dateTue, 24 Nov 2015 21:54:25 +0000
treeherdermozilla-central@d9243e369c22 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbotond
bugs1226920
milestone45.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 1226920 - For instances of ForEachNode where we want to traverse the entire tree, use an action that returns void. r=botond
gfx/layers/apz/src/APZCTreeManager.cpp
--- a/gfx/layers/apz/src/APZCTreeManager.cpp
+++ b/gfx/layers/apz/src/APZCTreeManager.cpp
@@ -166,17 +166,16 @@ APZCTreeManager::UpdateHitTestingTree(Co
   // layer was not found, and then do the destroy only at the end of the tree walk after
   // we are sure that the layer was removed and not just transplanted elsewhere. Doing that
   // as part of a recursive tree walk is hard and so maintaining a list and removing
   // APZCs that are still alive is much simpler.
   ForEachNode(mRootNode.get(),
       [&state] (HitTestingTreeNode* aNode)
       {
         state.mNodesToDestroy.AppendElement(aNode);
-        return TraversalFlag::Continue;
       });
   mRootNode = nullptr;
 
   if (aRoot) {
     mApzcTreeLog << "[start]\n";
     LayerMetricsWrapper root(aRoot);
     UpdateHitTestingTree(state, root,
                          // aCompositor is null in gtest scenarios
@@ -667,17 +666,16 @@ APZCTreeManager::FlushApzRepaints(uint64
         {
           if (aNode->IsPrimaryHolder()) {
             AsyncPanZoomController* apzc = aNode->GetApzc();
             MOZ_ASSERT(apzc);
             if (apzc->GetGuid().mLayersId == aLayersId) {
               apzc->FlushRepaintIfPending();
             }
           }
-	  return TraversalFlag::Continue;
         });
   }
   const CompositorParent::LayerTreeState* state = CompositorParent::GetIndirectShadowTree(aLayersId);
   MOZ_ASSERT(state && state->mController);
   NS_DispatchToMainThread(NS_NewRunnableMethod(
     state->mController.get(), &GeckoContentController::NotifyFlushComplete));
 }
 
@@ -1268,17 +1266,16 @@ APZCTreeManager::FlushRepaintsToClearScr
 
   ForEachNode(mRootNode.get(),
       [](HitTestingTreeNode* aNode)
       {
         if (aNode->IsPrimaryHolder()) {
           MOZ_ASSERT(aNode->GetApzc());
           aNode->GetApzc()->FlushRepaintForNewInputBlock();
         }
-	return TraversalFlag::Continue;
       });
 }
 
 void
 APZCTreeManager::CancelAnimation(const ScrollableLayerGuid &aGuid)
 {
   RefPtr<AsyncPanZoomController> apzc = GetTargetAPZC(aGuid);
   if (apzc) {
@@ -1301,17 +1298,16 @@ APZCTreeManager::ClearTree()
   // We can't destroy them as we collect them, because ForEachNode()
   // does a pre-order traversal of the tree, and Destroy() nulls out
   // the fields needed to reach the children of the node.
   nsTArray<RefPtr<HitTestingTreeNode>> nodesToDestroy;
   ForEachNode(mRootNode.get(),
       [&nodesToDestroy](HitTestingTreeNode* aNode)
       {
         nodesToDestroy.AppendElement(aNode);
-        return TraversalFlag::Continue;
       });
 
   for (size_t i = 0; i < nodesToDestroy.Length(); i++) {
     nodesToDestroy[i]->Destroy();
   }
   mRootNode = nullptr;
 }