Bug 1330359 - Fix building with -Werror for non-SPS platforms. r?mstange draft
authorJan Beich <jbeich@FreeBSD.org>
Wed, 11 Jan 2017 17:22:19 +0000
changeset 459301 2020bebfabeaab4edd67e52589439e4db73d5e83
parent 459259 63ad56438630b389efdb01632e153143cf3008ec
child 541856 32d68fcfe0cf9dc1c3f1bc7633a7f05208c9b107
push id41181
push userbmo:jbeich@FreeBSD.org
push dateWed, 11 Jan 2017 18:51:42 +0000
reviewersmstange
bugs1330359
milestone53.0a1
Bug 1330359 - Fix building with -Werror for non-SPS platforms. 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;