Bug 1145988 - Unbreak build on non-SPS platforms after bug 1129249. r=dholbert, f=chiajung, a=lizzard
authorJan Beich <jbeich@FreeBSD.org>
Thu, 02 Apr 2015 21:43:48 +0200
changeset 254861 7a6b36e4eac92bedc5731eaa84ace454b9c67fb1
parent 254860 caadbc2f51afa9c029da7318ebcabe2e5fd716b4
child 254862 229e75e75ef740c0c22754f4d02489c3182a3115
push id7886
push userryanvm@gmail.com
push dateMon, 06 Apr 2015 23:24:47 +0000
treeherdermozilla-aurora@7a6b36e4eac9 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdholbert, lizzard
bugs1145988, 1129249
milestone39.0a2
Bug 1145988 - Unbreak build on non-SPS platforms after bug 1129249. r=dholbert, f=chiajung, a=lizzard
layout/base/RestyleTracker.cpp
layout/base/RestyleTracker.h
tools/profiler/GeckoProfiler.h
--- a/layout/base/RestyleTracker.cpp
+++ b/layout/base/RestyleTracker.cpp
@@ -78,17 +78,19 @@ CollectLaterSiblings(nsISupports* aEleme
     collector->elements->AppendElement(element);
   }
 
   return PL_DHASH_NEXT;
 }
 
 struct RestyleEnumerateData : RestyleTracker::Hints {
   nsRefPtr<dom::Element> mElement;
+#ifdef MOZ_ENABLE_PROFILER_SPS
   UniquePtr<ProfilerBacktrace> mBacktrace;
+#endif
 };
 
 struct RestyleCollector {
   RestyleTracker* tracker;
   RestyleEnumerateData** restyleArrayPtr;
 #ifdef RESTYLE_LOGGING
   uint32_t count;
 #endif
@@ -136,17 +138,19 @@ CollectRestyles(nsISupports* aElement,
   element->UnsetFlags(collector->tracker->RestyleBit() |
                       collector->tracker->RootBit());
 
   RestyleEnumerateData** restyleArrayPtr = collector->restyleArrayPtr;
   RestyleEnumerateData* currentRestyle = *restyleArrayPtr;
   currentRestyle->mElement = element;
   currentRestyle->mRestyleHint = aData->mRestyleHint;
   currentRestyle->mChangeHint = aData->mChangeHint;
+#ifdef MOZ_ENABLE_PROFILER_SPS
   currentRestyle->mBacktrace = Move(aData->mBacktrace);
+#endif
 
 #ifdef RESTYLE_LOGGING
   collector->count++;
 #endif
 
   // Increment to the next slot in the array
   *restyleArrayPtr = currentRestyle + 1;
 
@@ -303,19 +307,21 @@ RestyleTracker::DoProcessRestyles()
 
         nsAutoPtr<RestyleData> data;
         if (!GetRestyleData(element, data)) {
           LOG_RESTYLE("skipping, already restyled");
           continue;
         }
 
         Maybe<GeckoProfilerTracingRAII> profilerRAII;
+#ifdef MOZ_ENABLE_PROFILER_SPS
         if (profiler_feature_active("restyle")) {
           profilerRAII.emplace("Paint", "Styles", Move(data->mBacktrace));
         }
+#endif
         ProcessOneRestyle(element, data->mRestyleHint, data->mChangeHint);
         AddRestyleRootsIfAwaitingRestyle(data->mDescendants);
       }
 
       if (mHaveLaterSiblingRestyles) {
         // Keep processing restyles for now
         continue;
       }
@@ -343,19 +349,21 @@ RestyleTracker::DoProcessRestyles()
              currentRestyle != lastRestyle;
              ++currentRestyle) {
           LOG_RESTYLE("processing pending restyle %s at index %d/%d",
                       FrameTagToString(currentRestyle->mElement).get(),
                       index++, collector.count);
           LOG_RESTYLE_INDENT();
 
           Maybe<GeckoProfilerTracingRAII> profilerRAII;
+#ifdef MOZ_ENABLE_PROFILER_SPS
           if (profiler_feature_active("restyle")) {
             profilerRAII.emplace("Paint", "Styles", Move(currentRestyle->mBacktrace));
           }
+#endif
           ProcessOneRestyle(currentRestyle->mElement,
                             currentRestyle->mRestyleHint,
                             currentRestyle->mChangeHint);
         }
       }
     }
   }
 
--- a/layout/base/RestyleTracker.h
+++ b/layout/base/RestyleTracker.h
@@ -11,18 +11,21 @@
 #ifndef mozilla_RestyleTracker_h
 #define mozilla_RestyleTracker_h
 
 #include "mozilla/dom/Element.h"
 #include "nsClassHashtable.h"
 #include "nsContainerFrame.h"
 #include "mozilla/SplayTree.h"
 #include "mozilla/RestyleLogging.h"
+#include "GeckoProfiler.h"
+
+#ifdef MOZ_ENABLE_PROFILER_SPS
 #include "ProfilerBacktrace.h"
-#include "GeckoProfiler.h"
+#endif
 
 namespace mozilla {
 
 class RestyleManager;
 class ElementRestyler;
 
 /** 
  * Helper class that collects a list of frames that need
@@ -288,17 +291,19 @@ public:
       mChangeHint = aChangeHint;
     }
 
     // Descendant elements we must check that we ended up restyling, ordered
     // with the same invariant as mRestyleRoots.  The elements here are those
     // that we called AddPendingRestyle for and found the element this is
     // the RestyleData for as its nearest restyle root.
     nsTArray<nsRefPtr<Element>> mDescendants;
+#ifdef MOZ_ENABLE_PROFILER_SPS
     UniquePtr<ProfilerBacktrace> mBacktrace;
+#endif
   };
 
   /**
    * If the given Element has a restyle pending for it, return the
    * relevant restyle data.  This function will clear everything other
    * than a possible eRestyle_LaterSiblings hint for aElement out of
    * our hashtable.  The returned aData will never have an
    * eRestyle_LaterSiblings hint in it.
@@ -387,19 +392,21 @@ RestyleTracker::AddPendingRestyleToTable
     mPendingRestyles.Get(aElement, &existingData);
   } else {
     aElement->SetFlags(RestyleBit());
     existingData = nullptr;
   }
 
   if (!existingData) {
     RestyleData* rd = new RestyleData(aRestyleHint, aMinChangeHint);
+#ifdef MOZ_ENABLE_PROFILER_SPS
     if (profiler_feature_active("restyle")) {
       rd->mBacktrace.reset(profiler_get_backtrace());
     }
+#endif
     mPendingRestyles.Put(aElement, rd);
     return false;
   }
 
   bool hadRestyleLaterSiblings =
     (existingData->mRestyleHint & eRestyle_LaterSiblings) != 0;
   existingData->mRestyleHint =
     nsRestyleHint(existingData->mRestyleHint | aRestyleHint);
--- a/tools/profiler/GeckoProfiler.h
+++ b/tools/profiler/GeckoProfiler.h
@@ -45,16 +45,17 @@
  * 't' - Elapse time since recording started.
  *
  */
 
 #ifndef SAMPLER_H
 #define SAMPLER_H
 
 #include "js/TypeDecls.h"
+#include "mozilla/GuardObjects.h"
 #include "mozilla/UniquePtr.h"
 
 namespace mozilla {
 class TimeStamp;
 }
 
 enum TracingMetadata {
   TRACING_DEFAULT,