Bug 1378312 - Unbreak --enable-warnings-as-errors without GeckoProfiler after bug 1375776. r?njn draft
authorJan Beich <jbeich@FreeBSD.org>
Mon, 10 Jul 2017 21:21:26 +0000
changeset 606528 fe6c8cec68501b6e7a82b8069898de9e35e3e63c
parent 606207 d6f2a893cd7a77cacbb1b139fff78d09c2f001e0
child 636781 34b3deb75ba9a72c36707ff85b3635b200886ba4
push id67715
push userbmo:jbeich@FreeBSD.org
push dateTue, 11 Jul 2017 01:41:58 +0000
reviewersnjn
bugs1378312, 1375776
milestone56.0a1
Bug 1378312 - Unbreak --enable-warnings-as-errors without GeckoProfiler after bug 1375776. r?njn MozReview-Commit-ID: tRlhZEZt7Z
tools/profiler/public/ProfilerMarkerPayload.h
--- a/tools/profiler/public/ProfilerMarkerPayload.h
+++ b/tools/profiler/public/ProfilerMarkerPayload.h
@@ -84,197 +84,239 @@ private:
 # define DECL_STREAM_PAYLOAD DECL_STREAM_PAYLOAD_BASE { MOZ_CRASH(); }
 #endif
 
 class TracingMarkerPayload : public ProfilerMarkerPayload
 {
 public:
   TracingMarkerPayload(const char* aCategory, TracingKind aKind,
                        UniqueProfilerBacktrace aCause = nullptr)
+#ifdef MOZ_GECKO_PROFILER
     : mCategory(aCategory)
     , mKind(aKind)
+#endif
   {
     if (aCause) {
       SetStack(Move(aCause));
     }
   }
 
   DECL_STREAM_PAYLOAD
 
 private:
+#ifdef MOZ_GECKO_PROFILER
   const char *mCategory;
   TracingKind mKind;
+#endif
 };
 
 class IOMarkerPayload : public ProfilerMarkerPayload
 {
 public:
   IOMarkerPayload(const char* aSource, const char* aFilename,
                   const mozilla::TimeStamp& aStartTime,
                   const mozilla::TimeStamp& aEndTime,
                   UniqueProfilerBacktrace aStack)
     : ProfilerMarkerPayload(aStartTime, aEndTime, Move(aStack))
+#ifdef MOZ_GECKO_PROFILER
     , mSource(aSource)
     , mFilename(aFilename ? strdup(aFilename) : nullptr)
+#endif
   {
     MOZ_ASSERT(aSource);
   }
 
   DECL_STREAM_PAYLOAD
 
 private:
+#ifdef MOZ_GECKO_PROFILER
   const char* mSource;
   mozilla::UniqueFreePtr<char> mFilename;
+#endif
 };
 
 class DOMEventMarkerPayload : public ProfilerMarkerPayload
 {
 public:
   DOMEventMarkerPayload(const nsAString& aType, uint16_t aPhase,
                         const mozilla::TimeStamp& aStartTime,
                         const mozilla::TimeStamp& aEndTime)
     : ProfilerMarkerPayload(aStartTime, aEndTime)
+#ifdef MOZ_GECKO_PROFILER
     , mType(aType)
     , mPhase(aPhase)
+#endif
   {}
 
   DECL_STREAM_PAYLOAD
 
 private:
+#ifdef MOZ_GECKO_PROFILER
   nsString mType;
   uint16_t mPhase;
+#endif
 };
 
 class UserTimingMarkerPayload : public ProfilerMarkerPayload
 {
 public:
   UserTimingMarkerPayload(const nsAString& aName,
                           const mozilla::TimeStamp& aStartTime)
     : ProfilerMarkerPayload(aStartTime, aStartTime)
+#ifdef MOZ_GECKO_PROFILER
     , mEntryType("mark")
     , mName(aName)
+#endif
   {}
 
   UserTimingMarkerPayload(const nsAString& aName,
                           const mozilla::TimeStamp& aStartTime,
                           const mozilla::TimeStamp& aEndTime)
     : ProfilerMarkerPayload(aStartTime, aEndTime)
+#ifdef MOZ_GECKO_PROFILER
     , mEntryType("measure")
     , mName(aName)
+#endif
   {}
 
   DECL_STREAM_PAYLOAD
 
 private:
+#ifdef MOZ_GECKO_PROFILER
   // Either "mark" or "measure".
   const char* mEntryType;
   nsString mName;
+#endif
 };
 
 // Contains the translation applied to a 2d layer so we can track the layer
 // position at each frame.
 class LayerTranslationMarkerPayload : public ProfilerMarkerPayload
 {
 public:
   LayerTranslationMarkerPayload(mozilla::layers::Layer* aLayer,
                                 mozilla::gfx::Point aPoint,
                                 mozilla::TimeStamp aStartTime)
     : ProfilerMarkerPayload(aStartTime, aStartTime)
+#ifdef MOZ_GECKO_PROFILER
     , mLayer(aLayer)
     , mPoint(aPoint)
+#endif
   {}
 
   DECL_STREAM_PAYLOAD
 
 private:
+#ifdef MOZ_GECKO_PROFILER
   mozilla::layers::Layer* mLayer;
   mozilla::gfx::Point mPoint;
+#endif
 };
 
 #include "Units.h"    // For ScreenIntPoint
 
 // Tracks when a vsync occurs according to the HardwareComposer.
 class VsyncMarkerPayload : public ProfilerMarkerPayload
 {
 public:
   explicit VsyncMarkerPayload(mozilla::TimeStamp aVsyncTimestamp)
     : ProfilerMarkerPayload(aVsyncTimestamp, aVsyncTimestamp)
+#ifdef MOZ_GECKO_PROFILER
     , mVsyncTimestamp(aVsyncTimestamp)
+#endif
   {}
 
   DECL_STREAM_PAYLOAD
 
 private:
+#ifdef MOZ_GECKO_PROFILER
   mozilla::TimeStamp mVsyncTimestamp;
+#endif
 };
 
 class GPUMarkerPayload : public ProfilerMarkerPayload
 {
 public:
   GPUMarkerPayload(const mozilla::TimeStamp& aCpuTimeStart,
                    const mozilla::TimeStamp& aCpuTimeEnd,
                    uint64_t aGpuTimeStart,
                    uint64_t aGpuTimeEnd)
     : ProfilerMarkerPayload(aCpuTimeStart, aCpuTimeEnd)
+#ifdef MOZ_GECKO_PROFILER
     , mCpuTimeStart(aCpuTimeStart)
     , mCpuTimeEnd(aCpuTimeEnd)
     , mGpuTimeStart(aGpuTimeStart)
     , mGpuTimeEnd(aGpuTimeEnd)
+#endif
   {}
 
   DECL_STREAM_PAYLOAD
 
 private:
+#ifdef MOZ_GECKO_PROFILER
   mozilla::TimeStamp mCpuTimeStart;
   mozilla::TimeStamp mCpuTimeEnd;
   uint64_t mGpuTimeStart;
   uint64_t mGpuTimeEnd;
+#endif
 };
 
 class GCSliceMarkerPayload : public ProfilerMarkerPayload
 {
 public:
   GCSliceMarkerPayload(const mozilla::TimeStamp& aStartTime,
                        const mozilla::TimeStamp& aEndTime,
                        JS::UniqueChars&& aTimingJSON)
-   : ProfilerMarkerPayload(aStartTime, aEndTime),
-     mTimingJSON(mozilla::Move(aTimingJSON))
+   : ProfilerMarkerPayload(aStartTime, aEndTime)
+#ifdef MOZ_GECKO_PROFILER
+   , mTimingJSON(mozilla::Move(aTimingJSON))
+#endif
   {}
 
   DECL_STREAM_PAYLOAD
 
 private:
+#ifdef MOZ_GECKO_PROFILER
   JS::UniqueChars mTimingJSON;
+#endif
 };
 
 class GCMajorMarkerPayload : public ProfilerMarkerPayload
 {
 public:
   GCMajorMarkerPayload(const mozilla::TimeStamp& aStartTime,
                        const mozilla::TimeStamp& aEndTime,
                        JS::UniqueChars&& aTimingJSON)
-   : ProfilerMarkerPayload(aStartTime, aEndTime),
-     mTimingJSON(mozilla::Move(aTimingJSON))
+   : ProfilerMarkerPayload(aStartTime, aEndTime)
+#ifdef MOZ_GECKO_PROFILER
+   , mTimingJSON(mozilla::Move(aTimingJSON))
+#endif
   {}
 
   DECL_STREAM_PAYLOAD
 
 private:
+#ifdef MOZ_GECKO_PROFILER
   JS::UniqueChars mTimingJSON;
+#endif
 };
 
 class GCMinorMarkerPayload : public ProfilerMarkerPayload
 {
 public:
   GCMinorMarkerPayload(const mozilla::TimeStamp& aStartTime,
                        const mozilla::TimeStamp& aEndTime,
                        JS::UniqueChars&& aTimingData)
-   : ProfilerMarkerPayload(aStartTime, aEndTime),
-     mTimingData(mozilla::Move(aTimingData))
+   : ProfilerMarkerPayload(aStartTime, aEndTime)
+#ifdef MOZ_GECKO_PROFILER
+   , mTimingData(mozilla::Move(aTimingData))
+#endif
   {}
 
   DECL_STREAM_PAYLOAD
 
 private:
+#ifdef MOZ_GECKO_PROFILER
   JS::UniqueChars mTimingData;
+#endif
 };
 
 #endif // ProfilerMarkerPayload_h