Bug 1330119 - Fix -Werror for non-SPS platforms, required by MOZ_AUTOMATION. r?mstange draft
authorJan Beich <jbeich@FreeBSD.org>
Wed, 11 Jan 2017 17:22:19 +0000
changeset 459294 173a6fb676c02c4eef568e3c411cb3ad138c5c62
parent 458771 2963cf6be7f830c0d2155e2968cfc53585868a76
child 541851 e64128bddef3594a92848b3bf17bc68c04f1b7ed
push id41176
push userbmo:jbeich@FreeBSD.org
push dateWed, 11 Jan 2017 17:46:57 +0000
reviewersmstange
bugs1330119
milestone53.0a1
Bug 1330119 - Fix -Werror for non-SPS platforms, required by MOZ_AUTOMATION. r?mstange MozReview-Commit-ID: Ifb3zyGHn7U
layout/base/PresShell.cpp
storage/TelemetryVFS.cpp
--- a/layout/base/PresShell.cpp
+++ b/layout/base/PresShell.cpp
@@ -9016,20 +9016,22 @@ PresShell::DoReflow(nsIFrame* target, bo
 
   target->SchedulePaint();
   nsIFrame *parent = nsLayoutUtils::GetCrossDocParentFrame(target);
   while (parent) {
     nsSVGEffects::InvalidateDirectRenderingObservers(parent);
     parent = nsLayoutUtils::GetCrossDocParentFrame(parent);
   }
 
+#ifdef MOZ_ENABLE_PROFILER_SPS
   nsIURI *uri = mDocument->GetDocumentURI();
   PROFILER_LABEL_PRINTF("PresShell", "DoReflow",
     js::ProfileEntry::Category::GRAPHICS, "(%s)",
     uri ? uri->GetSpecOrDefault().get() : "N/A");
+#endif
 
   nsDocShell* docShell = static_cast<nsDocShell*>(GetPresContext()->GetDocShell());
   RefPtr<TimelineConsumers> timelines = TimelineConsumers::Get();
   bool isTimelineRecording = timelines && timelines->HasConsumer(docShell);
 
   if (isTimelineRecording) {
     timelines->AddMarkerForDocShell(docShell, "Reflow", MarkerTracingType::START);
   }
--- a/storage/TelemetryVFS.cpp
+++ b/storage/TelemetryVFS.cpp
@@ -76,31 +76,35 @@ public:
    *
    * @param aOp optionally takes an IO operation to report through the
    * IOInterposer. Filename will be reported as NULL, and reference will be
    * either "sqlite-mainthread" or "sqlite-otherthread".
    */
   explicit IOThreadAutoTimer(Telemetry::ID aId,
     IOInterposeObserver::Operation aOp = IOInterposeObserver::OpNone)
     : start(TimeStamp::Now()),
-      id(aId),
-      op(aOp)
+      id(aId)
+#if defined(MOZ_ENABLE_PROFILER_SPS) && !defined(XP_WIN)
+      , op(aOp)
+#endif
   {
   }
 
   /**
    * This constructor is for when we want to report an operation to
    * IOInterposer but do not require a telemetry probe.
    *
    * @param aOp IO Operation to report through the IOInterposer.
    */
   explicit IOThreadAutoTimer(IOInterposeObserver::Operation aOp)
     : start(TimeStamp::Now()),
-      id(Telemetry::HistogramCount),
-      op(aOp)
+      id(Telemetry::HistogramCount)
+#if defined(MOZ_ENABLE_PROFILER_SPS) && !defined(XP_WIN)
+      , op(aOp)
+#endif
   {
   }
 
   ~IOThreadAutoTimer()
   {
     TimeStamp end(TimeStamp::Now());
     uint32_t mainThread = NS_IsMainThread() ? 1 : 0;
     if (id != Telemetry::HistogramCount) {
@@ -122,17 +126,19 @@ public:
       IOInterposer::Report(ob);
     }
 #endif /* defined(MOZ_ENABLE_PROFILER_SPS) && !defined(XP_WIN) */
   }
 
 private:
   const TimeStamp start;
   const Telemetry::ID id;
+#if defined(MOZ_ENABLE_PROFILER_SPS) && !defined(XP_WIN)
   IOInterposeObserver::Operation op;
+#endif
 };
 
 struct telemetry_file {
   // Base class.  Must be first
   sqlite3_file base;
 
   // histograms pertaining to this file
   Histograms *histograms;