Bug 1115812 patch 10 - Add RestyleTracker parameter to BeginProcessingRestyles. r=heycam
authorL. David Baron <dbaron@dbaron.org>
Tue, 13 Jan 2015 21:03:12 -0800
changeset 241184 ea9a26670eb9fbbf174d4ad5cee8ad808832dbd4
parent 241183 3758de260ac378e35844d00d58301f99855a544c
child 241185 fa9e8fe352a17e023f4dd0f272bda98967763882
push id7677
push userraliiev@mozilla.com
push dateMon, 23 Feb 2015 18:11:24 +0000
treeherdermozilla-aurora@f531d838c055 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersheycam
bugs1115812
milestone38.0a1
Bug 1115812 patch 10 - Add RestyleTracker parameter to BeginProcessingRestyles. r=heycam This is needed in patch 11.
layout/base/RestyleManager.cpp
layout/base/RestyleManager.h
layout/base/RestyleTracker.cpp
--- a/layout/base/RestyleManager.cpp
+++ b/layout/base/RestyleManager.cpp
@@ -1525,17 +1525,17 @@ RestyleManager::RebuildAllStyleData(nsCh
   // by just posting a style change -- except we really need to restyle
   // the root frame rather than the root element's primary frame.
   ProcessPendingRestyles();
 }
 
 void
 RestyleManager::DoRebuildAllStyleData(RestyleTracker& aRestyleTracker)
 {
-  BeginProcessingRestyles();
+  BeginProcessingRestyles(aRestyleTracker);
 
   mInRebuildAllStyleData = true;
 
   // Tell the style set to get the old rule tree out of the way
   // so we can recalculate while maintaining rule tree immutability
   nsresult rv = mPresContext->StyleSet()->BeginReconstruct();
   if (NS_FAILED(rv)) {
     return;
@@ -1675,17 +1675,17 @@ RestyleManager::ProcessPendingRestyles()
     // We probably wasted a lot of work up above, but this seems safest
     // and it should be rarely used.
     // This might add us as a refresh observer again; that's ok.
     RebuildAllStyleData(nsChangeHint(0), nsRestyleHint(0));
   }
 }
 
 void
-RestyleManager::BeginProcessingRestyles()
+RestyleManager::BeginProcessingRestyles(RestyleTracker& aRestyleTracker)
 {
   // Make sure to not rebuild quote or counter lists while we're
   // processing restyles
   mPresContext->FrameConstructor()->BeginUpdate();
 
   mInStyleRefresh = true;
 }
 
--- a/layout/base/RestyleManager.h
+++ b/layout/base/RestyleManager.h
@@ -273,17 +273,17 @@ public:
   void ProcessPendingRestyles();
 
   // Returns whether there are any pending restyles.
   bool HasPendingRestyles() { return mPendingRestyles.Count() != 0; }
 
   // ProcessPendingRestyles calls into one of our RestyleTracker
   // objects.  It then calls back to these functions at the beginning
   // and end of its work.
-  void BeginProcessingRestyles();
+  void BeginProcessingRestyles(RestyleTracker& aRestyleTracker);
   void EndProcessingRestyles();
 
   // Update styles for animations that are running on the compositor and
   // whose updating is suppressed on the main thread (to save
   // unnecessary work), while leaving all other aspects of style
   // out-of-date.
   //
   // Performs an animation-only style flush to make styles from
--- a/layout/base/RestyleTracker.cpp
+++ b/layout/base/RestyleTracker.cpp
@@ -190,17 +190,17 @@ RestyleTracker::ProcessOneRestyle(Elemen
 }
 
 void
 RestyleTracker::DoProcessRestyles()
 {
   PROFILER_LABEL("RestyleTracker", "ProcessRestyles",
     js::ProfileEntry::Category::CSS);
 
-  mRestyleManager->BeginProcessingRestyles();
+  mRestyleManager->BeginProcessingRestyles(*this);
 
   LOG_RESTYLE("Processing %d pending %srestyles with %d restyle roots for %s",
               mPendingRestyles.Count(),
               mRestyleManager->IsProcessingAnimationStyleChange()
                 ? (const char*) "animation " : (const char*) "",
               static_cast<int>(mRestyleRoots.Length()),
               GetDocumentURI(Document()).get());
   LOG_RESTYLE_INDENT();