Bug 1195232 - Stop using TracingMetadata from GeckoProfiler.h, r=tromey
authorVictor Porof <vporof@mozilla.com>
Mon, 31 Aug 2015 16:14:14 +0200
changeset 260089 e8615fd9bb21447df95bf84cd600b0b8ede08f51
parent 260088 ce62db17d0ec0315a282f66c081aed8ee0f75e5c
child 260090 ca7ff0423165f27224cef4f332a2038937568594
push id29300
push userryanvm@gmail.com
push dateMon, 31 Aug 2015 19:16:45 +0000
treeherdermozilla-central@ca7ff0423165 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstromey
bugs1195232
milestone43.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1195232 - Stop using TracingMetadata from GeckoProfiler.h, r=tromey
docshell/base/nsDocShell.cpp
docshell/base/nsDocShell.h
docshell/base/timeline/AutoGlobalTimelineMarker.cpp
docshell/base/timeline/AutoTimelineMarker.cpp
docshell/base/timeline/ConsoleTimelineMarker.h
docshell/base/timeline/EventTimelineMarker.h
docshell/base/timeline/JavascriptTimelineMarker.h
docshell/base/timeline/LayerTimelineMarker.h
docshell/base/timeline/ObservedDocShell.cpp
docshell/base/timeline/RestyleTimelineMarker.h
docshell/base/timeline/TimelineConsumers.cpp
docshell/base/timeline/TimelineConsumers.h
docshell/base/timeline/TimelineMarker.cpp
docshell/base/timeline/TimelineMarker.h
docshell/base/timeline/TimelineMarkerEnums.h
docshell/base/timeline/TimestampTimelineMarker.h
docshell/base/timeline/moz.build
dom/base/Console.cpp
dom/events/EventListenerManager.cpp
layout/base/RestyleTracker.cpp
layout/base/nsPresShell.cpp
layout/base/nsRefreshDriver.cpp
view/nsView.cpp
--- a/docshell/base/nsDocShell.cpp
+++ b/docshell/base/nsDocShell.cpp
@@ -13770,31 +13770,31 @@ nsDocShell::NotifyJSRunToCompletionStart
                                          const char16_t* aFilename,
                                          const uint32_t aLineNumber)
 {
   bool timelineOn = nsIDocShell::GetRecordProfileTimelineMarkers();
 
   // If first start, mark interval start.
   if (timelineOn && mJSRunToCompletionDepth == 0) {
     UniquePtr<TimelineMarker> marker = MakeUnique<JavascriptTimelineMarker>(
-      aReason, aFunctionName, aFilename, aLineNumber, TRACING_INTERVAL_START);
+      aReason, aFunctionName, aFilename, aLineNumber, MarkerTracingType::START);
     TimelineConsumers::AddMarkerForDocShell(this, Move(marker));
   }
   mJSRunToCompletionDepth++;
 }
 
 void
 nsDocShell::NotifyJSRunToCompletionStop()
 {
   bool timelineOn = nsIDocShell::GetRecordProfileTimelineMarkers();
 
   // If last stop, mark interval end.
   mJSRunToCompletionDepth--;
   if (timelineOn && mJSRunToCompletionDepth == 0) {
-    TimelineConsumers::AddMarkerForDocShell(this, "Javascript", TRACING_INTERVAL_END);
+    TimelineConsumers::AddMarkerForDocShell(this, "Javascript", MarkerTracingType::END);
   }
 }
 
 void
 nsDocShell::MaybeNotifyKeywordSearchLoading(const nsString& aProvider,
                                             const nsString& aKeyword)
 {
   if (aProvider.IsEmpty()) {
--- a/docshell/base/nsDocShell.h
+++ b/docshell/base/nsDocShell.h
@@ -270,24 +270,24 @@ private:
   mozilla::UniquePtr<mozilla::ObservedDocShell> mObserved;
   bool IsObserved() const { return !!mObserved; }
 
   // It is necessary to allow adding a timeline marker wherever a docshell
   // instance is available. This operation happens frequently and needs to
   // be very fast, so instead of using a Map or having to search for some
   // docshell-specific markers storage, a pointer to an `ObservedDocShell` is
   // is stored on docshells directly.
-  friend void mozilla::TimelineConsumers::AddConsumer(nsDocShell* aDocShell);
-  friend void mozilla::TimelineConsumers::RemoveConsumer(nsDocShell* aDocShell);
+  friend void mozilla::TimelineConsumers::AddConsumer(nsDocShell*);
+  friend void mozilla::TimelineConsumers::RemoveConsumer(nsDocShell*);
   friend void mozilla::TimelineConsumers::AddMarkerForDocShell(
-    nsDocShell* aDocShell, const char* aName, TracingMetadata aMetaData);
+    nsDocShell*, const char*, MarkerTracingType);
   friend void mozilla::TimelineConsumers::AddMarkerForDocShell(
-    nsDocShell* aDocShell, const char* aName, const TimeStamp& aTime, TracingMetadata aMetaData);
+    nsDocShell*, const char*, const TimeStamp&, MarkerTracingType);
   friend void mozilla::TimelineConsumers::AddMarkerForDocShell(
-    nsDocShell* aDocShell, UniquePtr<TimelineMarker>&& aMarker);
+    nsDocShell*, UniquePtr<TimelineMarker>&&);
 
 public:
   // Tell the favicon service that aNewURI has the same favicon as aOldURI.
   static void CopyFavicon(nsIURI* aOldURI,
                           nsIURI* aNewURI,
                           bool aInPrivateBrowsing);
 
 protected:
--- a/docshell/base/timeline/AutoGlobalTimelineMarker.cpp
+++ b/docshell/base/timeline/AutoGlobalTimelineMarker.cpp
@@ -17,21 +17,21 @@ AutoGlobalTimelineMarker::AutoGlobalTime
 {
   MOZ_GUARD_OBJECT_NOTIFIER_INIT;
   MOZ_ASSERT(NS_IsMainThread());
 
   if (TimelineConsumers::IsEmpty()) {
     return;
   }
 
-  TimelineConsumers::AddMarkerForAllObservedDocShells(mName, TRACING_INTERVAL_START);
+  TimelineConsumers::AddMarkerForAllObservedDocShells(mName, MarkerTracingType::START);
 }
 
 AutoGlobalTimelineMarker::~AutoGlobalTimelineMarker()
 {
   if (TimelineConsumers::IsEmpty()) {
     return;
   }
 
-  TimelineConsumers::AddMarkerForAllObservedDocShells(mName, TRACING_INTERVAL_END);
+  TimelineConsumers::AddMarkerForAllObservedDocShells(mName, MarkerTracingType::END);
 }
 
 } // namespace mozilla
--- a/docshell/base/timeline/AutoTimelineMarker.cpp
+++ b/docshell/base/timeline/AutoTimelineMarker.cpp
@@ -20,21 +20,21 @@ AutoTimelineMarker::AutoTimelineMarker(n
   MOZ_GUARD_OBJECT_NOTIFIER_INIT;
   MOZ_ASSERT(NS_IsMainThread());
 
   if (!aDocShell || TimelineConsumers::IsEmpty()) {
     return;
   }
 
   mDocShell = static_cast<nsDocShell*>(aDocShell);
-  TimelineConsumers::AddMarkerForDocShell(mDocShell, mName, TRACING_INTERVAL_START);
+  TimelineConsumers::AddMarkerForDocShell(mDocShell, mName, MarkerTracingType::START);
 }
 
 AutoTimelineMarker::~AutoTimelineMarker()
 {
   if (!mDocShell || TimelineConsumers::IsEmpty()) {
     return;
   }
 
-  TimelineConsumers::AddMarkerForDocShell(mDocShell, mName, TRACING_INTERVAL_END);
+  TimelineConsumers::AddMarkerForDocShell(mDocShell, mName, MarkerTracingType::END);
 }
 
 } // namespace mozilla
--- a/docshell/base/timeline/ConsoleTimelineMarker.h
+++ b/docshell/base/timeline/ConsoleTimelineMarker.h
@@ -11,23 +11,23 @@
 #include "mozilla/dom/ProfileTimelineMarkerBinding.h"
 
 namespace mozilla {
 
 class ConsoleTimelineMarker : public TimelineMarker
 {
 public:
   explicit ConsoleTimelineMarker(const nsAString& aCause,
-                                 TracingMetadata aMetaData)
-    : TimelineMarker("ConsoleTime", aMetaData)
+                                 MarkerTracingType aTracingType)
+    : TimelineMarker("ConsoleTime", aTracingType)
     , mCause(aCause)
   {
     // Stack is captured by default on the "start" marker. Explicitly also
     // capture stack on the "end" marker.
-    if (aMetaData == TRACING_INTERVAL_END) {
+    if (aTracingType == MarkerTracingType::END) {
       CaptureStack();
     }
   }
 
   virtual bool Equals(const TimelineMarker& aOther) override
   {
     if (!TimelineMarker::Equals(aOther)) {
       return false;
@@ -35,17 +35,17 @@ public:
     // Console markers must have matching causes as well. It is safe to perform
     // a static_cast here as the previous equality check ensures that this is
     // a console marker instance.
     return mCause == static_cast<const ConsoleTimelineMarker*>(&aOther)->mCause;
   }
 
   virtual void AddDetails(JSContext* aCx, dom::ProfileTimelineMarker& aMarker) override
   {
-    if (GetMetaData() == TRACING_INTERVAL_START) {
+    if (GetTracingType() == MarkerTracingType::START) {
       aMarker.mCauseName.Construct(mCause);
     } else {
       aMarker.mEndStack = GetStack();
     }
   }
 
 private:
   nsString mCause;
--- a/docshell/base/timeline/EventTimelineMarker.h
+++ b/docshell/base/timeline/EventTimelineMarker.h
@@ -12,25 +12,25 @@
 
 namespace mozilla {
 
 class EventTimelineMarker : public TimelineMarker
 {
 public:
   explicit EventTimelineMarker(const nsAString& aType,
                                uint16_t aPhase,
-                               TracingMetadata aMetaData)
-    : TimelineMarker("DOMEvent", aMetaData)
+                               MarkerTracingType aTracingType)
+    : TimelineMarker("DOMEvent", aTracingType)
     , mType(aType)
     , mPhase(aPhase)
   {}
 
   virtual void AddDetails(JSContext* aCx, dom::ProfileTimelineMarker& aMarker) override
   {
-    if (GetMetaData() == TRACING_INTERVAL_START) {
+    if (GetTracingType() == MarkerTracingType::START) {
       aMarker.mType.Construct(mType);
       aMarker.mEventPhase.Construct(mPhase);
     }
   }
 
 private:
   nsString mType;
   uint16_t mPhase;
--- a/docshell/base/timeline/JavascriptTimelineMarker.h
+++ b/docshell/base/timeline/JavascriptTimelineMarker.h
@@ -16,18 +16,18 @@ namespace mozilla {
 
 class JavascriptTimelineMarker : public TimelineMarker
 {
 public:
   explicit JavascriptTimelineMarker(const char* aReason,
                                     const char16_t* aFunctionName,
                                     const char16_t* aFileName,
                                     uint32_t aLineNumber,
-                                    TracingMetadata aMetaData)
-    : TimelineMarker("Javascript", aMetaData, NO_STACK)
+                                    MarkerTracingType aTracingType)
+    : TimelineMarker("Javascript", aTracingType, MarkerStackRequest::NO_STACK)
     , mCause(NS_ConvertUTF8toUTF16(aReason))
     , mFunctionName(aFunctionName)
     , mFileName(aFileName)
     , mLineNumber(aLineNumber)
   {}
 
   virtual void AddDetails(JSContext* aCx, dom::ProfileTimelineMarker& aMarker) override
   {
--- a/docshell/base/timeline/LayerTimelineMarker.h
+++ b/docshell/base/timeline/LayerTimelineMarker.h
@@ -11,17 +11,17 @@
 #include "mozilla/dom/ProfileTimelineMarkerBinding.h"
 
 namespace mozilla {
 
 class LayerTimelineMarker : public TimelineMarker
 {
 public:
   explicit LayerTimelineMarker(const nsIntRegion& aRegion)
-    : TimelineMarker("Layer", TRACING_EVENT)
+    : TimelineMarker("Layer", MarkerTracingType::HELPER_EVENT)
     , mRegion(aRegion)
   {}
 
   ~LayerTimelineMarker()
   {}
 
   void AddLayerRectangles(dom::Sequence<dom::ProfileTimelineLayerRect>& aRectangles)
   {
--- a/docshell/base/timeline/ObservedDocShell.cpp
+++ b/docshell/base/timeline/ObservedDocShell.cpp
@@ -34,31 +34,31 @@ ObservedDocShell::PopMarkers(JSContext* 
 {
   // If we see an unpaired START, we keep it around for the next call
   // to ObservedDocShell::PopMarkers. We store the kept START objects here.
   nsTArray<UniquePtr<TimelineMarker>> keptStartMarkers;
 
   for (uint32_t i = 0; i < mTimelineMarkers.Length(); ++i) {
     UniquePtr<TimelineMarker>& startPayload = mTimelineMarkers[i];
 
-    // If this is a TRACING_TIMESTAMP marker, there's no corresponding END
+    // If this is a TIMESTAMP marker, there's no corresponding END,
     // as it's a single unit of time, not a duration.
-    if (startPayload->GetMetaData() == TRACING_TIMESTAMP) {
+    if (startPayload->GetTracingType() == MarkerTracingType::TIMESTAMP) {
       dom::ProfileTimelineMarker* marker = aStore.AppendElement();
       marker->mName = NS_ConvertUTF8toUTF16(startPayload->GetName());
       marker->mStart = startPayload->GetTime();
       marker->mEnd = startPayload->GetTime();
       marker->mStack = startPayload->GetStack();
       startPayload->AddDetails(aCx, *marker);
       continue;
     }
 
     // Whenever a START marker is found, look for the corresponding END
     // and build a {name,start,end} JS object.
-    if (startPayload->GetMetaData() == TRACING_INTERVAL_START) {
+    if (startPayload->GetTracingType() == MarkerTracingType::START) {
       bool hasSeenEnd = false;
 
       // "Paint" markers are different because painting is handled at root
       // docshell level. The information that a paint was done is stored at
       // sub-docshell level, but we can only be sure that a paint did actually
       // happen in if a "Layer" marker was recorded too.
       bool startIsPaintType = strcmp(startPayload->GetName(), "Paint") == 0;
       bool hasSeenLayerType = false;
@@ -83,21 +83,21 @@ ObservedDocShell::PopMarkers(JSContext* 
         if (startIsPaintType && endIsLayerType) {
           LayerTimelineMarker* layerPayload = static_cast<LayerTimelineMarker*>(endPayload.get());
           layerPayload->AddLayerRectangles(layerRectangles);
           hasSeenLayerType = true;
         }
         if (!startPayload->Equals(*endPayload)) {
           continue;
         }
-        if (endPayload->GetMetaData() == TRACING_INTERVAL_START) {
+        if (endPayload->GetTracingType() == MarkerTracingType::START) {
           ++markerDepth;
           continue;
         }
-        if (endPayload->GetMetaData() == TRACING_INTERVAL_END) {
+        if (endPayload->GetTracingType() == MarkerTracingType::END) {
           if (markerDepth > 0) {
             --markerDepth;
             continue;
           }
           if (!startIsPaintType || (startIsPaintType && hasSeenLayerType)) {
             dom::ProfileTimelineMarker* marker = aStore.AppendElement();
             marker->mName = NS_ConvertUTF8toUTF16(startPayload->GetName());
             marker->mStart = startPayload->GetTime();
--- a/docshell/base/timeline/RestyleTimelineMarker.h
+++ b/docshell/base/timeline/RestyleTimelineMarker.h
@@ -11,27 +11,27 @@
 #include "mozilla/dom/ProfileTimelineMarkerBinding.h"
 
 namespace mozilla {
 
 class RestyleTimelineMarker : public TimelineMarker
 {
 public:
   explicit RestyleTimelineMarker(nsRestyleHint aRestyleHint,
-                                 TracingMetadata aMetaData)
-    : TimelineMarker("Styles", aMetaData)
+                                 MarkerTracingType aTracingType)
+    : TimelineMarker("Styles", aTracingType)
   {
     if (aRestyleHint) {
       mRestyleHint.AssignWithConversion(RestyleManager::RestyleHintToString(aRestyleHint));
     }
   }
 
   virtual void AddDetails(JSContext* aCx, dom::ProfileTimelineMarker& aMarker) override
   {
-    if (GetMetaData() == TRACING_INTERVAL_START) {
+    if (GetTracingType() == MarkerTracingType::START) {
       aMarker.mRestyleHint.Construct(mRestyleHint);
     }
   }
 
 private:
   nsAutoString mRestyleHint;
 };
 
--- a/docshell/base/timeline/TimelineConsumers.cpp
+++ b/docshell/base/timeline/TimelineConsumers.cpp
@@ -63,86 +63,86 @@ TimelineConsumers::GetKnownDocShells(Vec
   }
 
   return true;
 }
 
 void
 TimelineConsumers::AddMarkerForDocShell(nsDocShell* aDocShell,
                                         const char* aName,
-                                        TracingMetadata aMetaData)
+                                        MarkerTracingType aTracingType)
 {
   if (aDocShell->IsObserved()) {
-    aDocShell->mObserved->AddMarker(Move(MakeUnique<TimelineMarker>(aName, aMetaData)));
+    aDocShell->mObserved->AddMarker(Move(MakeUnique<TimelineMarker>(aName, aTracingType)));
   }
 }
 
 void
 TimelineConsumers::AddMarkerForDocShell(nsDocShell* aDocShell,
                                         const char* aName,
                                         const TimeStamp& aTime,
-                                        TracingMetadata aMetaData)
+                                        MarkerTracingType aTracingType)
 {
   if (aDocShell->IsObserved()) {
-    aDocShell->mObserved->AddMarker(Move(MakeUnique<TimelineMarker>(aName, aTime, aMetaData)));
+    aDocShell->mObserved->AddMarker(Move(MakeUnique<TimelineMarker>(aName, aTime, aTracingType)));
   }
 }
 
 void
 TimelineConsumers::AddMarkerForDocShell(nsDocShell* aDocShell,
                                         UniquePtr<TimelineMarker>&& aMarker)
 {
   if (aDocShell->IsObserved()) {
     aDocShell->mObserved->AddMarker(Move(aMarker));
   }
 }
 
 void
 TimelineConsumers::AddMarkerForDocShell(nsIDocShell* aDocShell,
                                         const char* aName,
-                                        TracingMetadata aMetaData)
+                                        MarkerTracingType aTracingType)
 {
-  AddMarkerForDocShell(static_cast<nsDocShell*>(aDocShell), aName, aMetaData);
+  AddMarkerForDocShell(static_cast<nsDocShell*>(aDocShell), aName, aTracingType);
 }
 
 void
 TimelineConsumers::AddMarkerForDocShell(nsIDocShell* aDocShell,
                                         const char* aName,
                                         const TimeStamp& aTime,
-                                        TracingMetadata aMetaData)
+                                        MarkerTracingType aTracingType)
 {
-  AddMarkerForDocShell(static_cast<nsDocShell*>(aDocShell), aName, aTime, aMetaData);
+  AddMarkerForDocShell(static_cast<nsDocShell*>(aDocShell), aName, aTime, aTracingType);
 }
 
 void
 TimelineConsumers::AddMarkerForDocShell(nsIDocShell* aDocShell,
                                         UniquePtr<TimelineMarker>&& aMarker)
 {
   AddMarkerForDocShell(static_cast<nsDocShell*>(aDocShell), Move(aMarker));
 }
 
 void
 TimelineConsumers::AddMarkerForDocShellsList(Vector<nsRefPtr<nsDocShell>>& aDocShells,
                                              const char* aName,
-                                             TracingMetadata aMetaData)
+                                             MarkerTracingType aTracingType)
 {
   for (Vector<nsRefPtr<nsDocShell>>::Range range = aDocShells.all();
        !range.empty();
        range.popFront()) {
-    AddMarkerForDocShell(range.front(), aName, aMetaData);
+    AddMarkerForDocShell(range.front(), aName, aTracingType);
   }
 }
 
 void
 TimelineConsumers::AddMarkerForAllObservedDocShells(const char* aName,
-                                                    TracingMetadata aMetaData)
+                                                    MarkerTracingType aTracingType)
 {
   Vector<nsRefPtr<nsDocShell>> docShells;
   if (!GetKnownDocShells(docShells)) {
     // If we don't successfully populate our vector with *all* docshells being
     // observed, don't add the marker to *any* of them.
     return;
   }
 
-  AddMarkerForDocShellsList(docShells, aName, aMetaData);
+  AddMarkerForDocShellsList(docShells, aName, aTracingType);
 }
 
 } // namespace mozilla
--- a/docshell/base/timeline/TimelineConsumers.h
+++ b/docshell/base/timeline/TimelineConsumers.h
@@ -5,17 +5,19 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef mozilla_TimelineConsumers_h_
 #define mozilla_TimelineConsumers_h_
 
 #include "mozilla/UniquePtr.h"
 #include "mozilla/LinkedList.h"
 #include "mozilla/Vector.h"
-#include "GeckoProfiler.h"
+#include "mozilla/TimeStamp.h"
+
+#include "TimelineMarkerEnums.h"
 
 class nsDocShell;
 class nsIDocShell;
 
 namespace mozilla {
 class ObservedDocShell;
 class TimelineMarker;
 
@@ -41,43 +43,43 @@ public:
   // observed by a timeline. Markers tied to a particular docshell won't be
   // created unless that docshell is specifically being currently observed.
   // See nsIDocShell::recordProfileTimelineMarkers
 
   // These methods create a custom marker from a name and some metadata,
   // relevant for a specific docshell.
   static void AddMarkerForDocShell(nsDocShell* aDocShell,
                                    const char* aName,
-                                   TracingMetadata aMetaData);
+                                   MarkerTracingType aTracingType);
   static void AddMarkerForDocShell(nsIDocShell* aDocShell,
                                    const char* aName,
-                                   TracingMetadata aMetaData);
+                                   MarkerTracingType aTracingType);
 
   static void AddMarkerForDocShell(nsDocShell* aDocShell,
                                    const char* aName,
                                    const TimeStamp& aTime,
-                                   TracingMetadata aMetaData);
+                                   MarkerTracingType aTracingType);
   static void AddMarkerForDocShell(nsIDocShell* aDocShell,
                                    const char* aName,
                                    const TimeStamp& aTime,
-                                   TracingMetadata aMetaData);
+                                   MarkerTracingType aTracingType);
 
   // These methods register and receive ownership of an already created marker,
   // relevant for a specific docshell.
   static void AddMarkerForDocShell(nsDocShell* aDocShell,
                                    UniquePtr<TimelineMarker>&& aMarker);
   static void AddMarkerForDocShell(nsIDocShell* aDocShell,
                                    UniquePtr<TimelineMarker>&& aMarker);
 
   // This method creates custom markers, relevant for a list of docshells.
   static void AddMarkerForDocShellsList(Vector<nsRefPtr<nsDocShell>>& aDocShells,
                                         const char* aName,
-                                        TracingMetadata aMetaData);
+                                        MarkerTracingType aTracingType);
 
   // This method creates custom markers, none of which have to be tied to a
   // particular docshell.
   static void AddMarkerForAllObservedDocShells(const char* aName,
-                                               TracingMetadata aMetaData);
+                                               MarkerTracingType aTracingType);
 };
 
 } // namespace mozilla
 
 #endif /* mozilla_TimelineConsumers_h_ */
--- a/docshell/base/timeline/TimelineMarker.cpp
+++ b/docshell/base/timeline/TimelineMarker.cpp
@@ -4,65 +4,61 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "TimelineMarker.h"
 
 namespace mozilla {
 
 TimelineMarker::TimelineMarker(const char* aName,
-                               TracingMetadata aMetaData,
-                               TimelineStackRequest aStackRequest)
+                               MarkerTracingType aTracingType,
+                               MarkerStackRequest aStackRequest)
   : mName(aName)
-  , mMetaData(aMetaData)
+  , mTracingType(aTracingType)
 {
   MOZ_COUNT_CTOR(TimelineMarker);
-  MOZ_ASSERT(aName);
-
   SetCurrentTime();
-  CaptureStackIfNecessary(aMetaData, aStackRequest);
+  CaptureStackIfNecessary(aTracingType, aStackRequest);
 }
 
 TimelineMarker::TimelineMarker(const char* aName,
                                const TimeStamp& aTime,
-                               TracingMetadata aMetaData,
-                               TimelineStackRequest aStackRequest)
+                               MarkerTracingType aTracingType,
+                               MarkerStackRequest aStackRequest)
   : mName(aName)
-  , mMetaData(aMetaData)
+  , mTracingType(aTracingType)
 {
   MOZ_COUNT_CTOR(TimelineMarker);
-  MOZ_ASSERT(aName);
-
   SetCustomTime(aTime);
-  CaptureStackIfNecessary(aMetaData, aStackRequest);
+  CaptureStackIfNecessary(aTracingType, aStackRequest);
 }
 
 TimelineMarker::~TimelineMarker()
 {
   MOZ_COUNT_DTOR(TimelineMarker);
 }
 
 void
 TimelineMarker::SetCurrentTime()
 {
-  TimeStamp now = TimeStamp::Now();
-  SetCustomTime(now);
+ TimeStamp now = TimeStamp::Now();
+ SetCustomTime(now);
 }
 
 void
 TimelineMarker::SetCustomTime(const TimeStamp& aTime)
 {
   bool isInconsistent = false;
   mTime = (aTime - TimeStamp::ProcessCreation(isInconsistent)).ToMilliseconds();
 }
 
 void
-TimelineMarker::CaptureStackIfNecessary(TracingMetadata aMetaData,
-                                        TimelineStackRequest aStackRequest)
+TimelineMarker::CaptureStackIfNecessary(MarkerTracingType aTracingType,
+                                        MarkerStackRequest aStackRequest)
 {
-  if ((aMetaData == TRACING_INTERVAL_START ||
-      aMetaData == TRACING_TIMESTAMP) &&
-      aStackRequest != NO_STACK) {
+  if ((aTracingType == MarkerTracingType::START ||
+      aTracingType == MarkerTracingType::TIMESTAMP) &&
+      aStackRequest != MarkerStackRequest::NO_STACK) {
     CaptureStack();
   }
 }
 
 } // namespace mozilla
--- a/docshell/base/timeline/TimelineMarker.h
+++ b/docshell/base/timeline/TimelineMarker.h
@@ -4,41 +4,39 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef mozilla_TimelineMarker_h_
 #define mozilla_TimelineMarker_h_
 
 #include "nsString.h"
 #include "nsContentUtils.h"
-#include "GeckoProfiler.h"
+#include "TimelineMarkerEnums.h"
 
 class nsDocShell;
 
 namespace mozilla {
 namespace dom {
 struct ProfileTimelineMarker;
 }
 
 // Objects of this type can be added to the timeline if there is an interested
 // consumer. The class can also be subclassed to let a given marker creator
 // provide custom details.
 class TimelineMarker
 {
 public:
-  enum TimelineStackRequest { STACK, NO_STACK };
-
   TimelineMarker(const char* aName,
-                 TracingMetadata aMetaData,
-                 TimelineStackRequest aStackRequest = STACK);
+                 MarkerTracingType aTracingType,
+                 MarkerStackRequest aStackRequest = MarkerStackRequest::STACK);
 
   TimelineMarker(const char* aName,
                  const TimeStamp& aTime,
-                 TracingMetadata aMetaData,
-                 TimelineStackRequest aStackRequest = STACK);
+                 MarkerTracingType aTracingType,
+                 MarkerStackRequest aStackRequest = MarkerStackRequest::STACK);
 
   virtual ~TimelineMarker();
 
   // Check whether two markers should be considered the same, for the purpose
   // of pairing start and end markers. Normally this definition suffices.
   virtual bool Equals(const TimelineMarker& aOther)
   {
     return strcmp(mName, aOther.mName) == 0;
@@ -48,17 +46,17 @@ public:
   // have already been set. This method is called on both the starting and
   // ending markers of a pair. Ordinarily the ending marker doesn't need to do
   // anything here.
   virtual void AddDetails(JSContext* aCx, dom::ProfileTimelineMarker& aMarker)
   {}
 
   const char* GetName() const { return mName; }
   DOMHighResTimeStamp GetTime() const { return mTime; }
-  TracingMetadata GetMetaData() const { return mMetaData; }
+  MarkerTracingType GetTracingType() const { return mTracingType; }
 
   JSObject* GetStack()
   {
     if (mStackTrace.initialized()) {
       return mStackTrace;
     }
     return nullptr;
   }
@@ -75,25 +73,25 @@ protected:
         JS_ClearPendingException(ctx);
       }
     }
   }
 
 private:
   const char* mName;
   DOMHighResTimeStamp mTime;
-  TracingMetadata mMetaData;
+  MarkerTracingType mTracingType;
 
   // While normally it is not a good idea to make a persistent root,
   // in this case changing nsDocShell to participate in cycle
   // collection was deemed too invasive, and the markers are only held
   // here temporarily to boot.
   JS::PersistentRooted<JSObject*> mStackTrace;
 
   void SetCurrentTime();
   void SetCustomTime(const TimeStamp& aTime);
-  void CaptureStackIfNecessary(TracingMetadata aMetaData,
-                               TimelineStackRequest aStackRequest);
+  void CaptureStackIfNecessary(MarkerTracingType aTracingType,
+                               MarkerStackRequest aStackRequest);
 };
 
 } // namespace mozilla
 
 #endif /* mozilla_TimelineMarker_h_ */
new file mode 100644
--- /dev/null
+++ b/docshell/base/timeline/TimelineMarkerEnums.h
@@ -0,0 +1,26 @@
+/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* vim: set ts=8 sts=2 et sw=2 tw=80: */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+#ifndef mozilla_TimelineMarkerEnums_h_
+#define mozilla_TimelineMarkerEnums_h_
+
+namespace mozilla {
+
+enum class MarkerTracingType {
+  START,
+  END,
+  TIMESTAMP,
+  HELPER_EVENT
+};
+
+enum class MarkerStackRequest {
+  STACK,
+  NO_STACK
+};
+
+} // namespace mozilla
+
+#endif // mozilla_TimelineMarkerEnums_h_
--- a/docshell/base/timeline/TimestampTimelineMarker.h
+++ b/docshell/base/timeline/TimestampTimelineMarker.h
@@ -11,17 +11,17 @@
 #include "mozilla/dom/ProfileTimelineMarkerBinding.h"
 
 namespace mozilla {
 
 class TimestampTimelineMarker : public TimelineMarker
 {
 public:
   explicit TimestampTimelineMarker(const nsAString& aCause)
-    : TimelineMarker("TimeStamp", TRACING_TIMESTAMP)
+    : TimelineMarker("TimeStamp", MarkerTracingType::TIMESTAMP)
     , mCause(aCause)
   {}
 
   virtual void AddDetails(JSContext* aCx, dom::ProfileTimelineMarker& aMarker) override
   {
     if (!mCause.IsEmpty()) {
       aMarker.mCauseName.Construct(mCause);
     }
--- a/docshell/base/timeline/moz.build
+++ b/docshell/base/timeline/moz.build
@@ -10,16 +10,17 @@ EXPORTS.mozilla += [
     'ConsoleTimelineMarker.h',
     'EventTimelineMarker.h',
     'JavascriptTimelineMarker.h',
     'LayerTimelineMarker.h',
     'ObservedDocShell.h',
     'RestyleTimelineMarker.h',
     'TimelineConsumers.h',
     'TimelineMarker.h',
+    'TimelineMarkerEnums.h',
     'TimestampTimelineMarker.h',
 ]
 
 UNIFIED_SOURCES += [
     'AutoGlobalTimelineMarker.cpp',
     'AutoTimelineMarker.cpp',
     'ObservedDocShell.cpp',
     'TimelineConsumers.cpp',
--- a/dom/base/Console.cpp
+++ b/dom/base/Console.cpp
@@ -1099,18 +1099,18 @@ Console::Method(JSContext* aCx, MethodNa
       // For `console.time(foo)` and `console.timeEnd(foo)`
       else if (isTimelineRecording && aData.Length() == 1) {
         JS::Rooted<JS::Value> value(aCx, aData[0]);
         JS::Rooted<JSString*> jsString(aCx, JS::ToString(aCx, value));
         if (jsString) {
           nsAutoJSString key;
           if (key.init(aCx, jsString)) {
             UniquePtr<TimelineMarker> marker = MakeUnique<ConsoleTimelineMarker>(
-              key, aMethodName == MethodTime ? TRACING_INTERVAL_START
-                                             : TRACING_INTERVAL_END);
+              key, aMethodName == MethodTime ? MarkerTracingType::START
+                                             : MarkerTracingType::END);
             TimelineConsumers::AddMarkerForDocShell(docShell, Move(marker));
           }
         }
       }
 
     } else {
       WorkerPrivate* workerPrivate = GetCurrentThreadWorkerPrivate();
       MOZ_ASSERT(workerPrivate);
--- a/dom/events/EventListenerManager.cpp
+++ b/dom/events/EventListenerManager.cpp
@@ -1123,29 +1123,29 @@ EventListenerManager::HandleEventInterna
             }
             if (isTimelineRecording) {
               nsDocShell* ds = static_cast<nsDocShell*>(docShell.get());
               nsAutoString typeStr;
               (*aDOMEvent)->GetType(typeStr);
               uint16_t phase;
               (*aDOMEvent)->GetEventPhase(&phase);
               UniquePtr<TimelineMarker> marker = MakeUnique<EventTimelineMarker>(
-                typeStr, phase, TRACING_INTERVAL_START);
+                typeStr, phase, MarkerTracingType::START);
               TimelineConsumers::AddMarkerForDocShell(ds, Move(marker));
             }
           }
 
           if (NS_FAILED(HandleEventSubType(listener, *aDOMEvent,
                                            aCurrentTarget))) {
             aEvent->mFlags.mExceptionHasBeenRisen = true;
           }
 
           if (isTimelineRecording) {
             nsDocShell* ds = static_cast<nsDocShell*>(docShell.get());
-            TimelineConsumers::AddMarkerForDocShell(ds, "DOMEvent", TRACING_INTERVAL_END);
+            TimelineConsumers::AddMarkerForDocShell(ds, "DOMEvent", MarkerTracingType::END);
           }
         }
       }
     }
   }
 
   aEvent->currentTarget = nullptr;
 
--- a/layout/base/RestyleTracker.cpp
+++ b/layout/base/RestyleTracker.cpp
@@ -330,33 +330,33 @@ RestyleTracker::DoProcessRestyles()
         nsAutoPtr<RestyleData> data;
         if (!GetRestyleData(element, data)) {
           LOG_RESTYLE("skipping, already restyled");
           continue;
         }
 
         if (isTimelineRecording) {
           UniquePtr<TimelineMarker> marker = MakeUnique<RestyleTimelineMarker>(
-            data->mRestyleHint, TRACING_INTERVAL_START);
+            data->mRestyleHint, MarkerTracingType::START);
           TimelineConsumers::AddMarkerForDocShell(docShell, Move(marker));
         }
 
 #if defined(MOZ_ENABLE_PROFILER_SPS) && !defined(MOZILLA_XPCOMRT_API)
         Maybe<GeckoProfilerTracingRAII> profilerRAII;
         if (profiler_feature_active("restyle")) {
           profilerRAII.emplace("Paint", "Styles", Move(data->mBacktrace));
         }
 #endif
         ProcessOneRestyle(element, data->mRestyleHint, data->mChangeHint,
                           data->mRestyleHintData);
         AddRestyleRootsIfAwaitingRestyle(data->mDescendants);
 
         if (isTimelineRecording) {
           UniquePtr<TimelineMarker> marker = MakeUnique<RestyleTimelineMarker>(
-            data->mRestyleHint, TRACING_INTERVAL_END);
+            data->mRestyleHint, MarkerTracingType::END);
           TimelineConsumers::AddMarkerForDocShell(docShell, Move(marker));
         }
       }
 
       if (mHaveLaterSiblingRestyles) {
         // Keep processing restyles for now
         continue;
       }
@@ -391,28 +391,28 @@ RestyleTracker::DoProcessRestyles()
 #if defined(MOZ_ENABLE_PROFILER_SPS) && !defined(MOZILLA_XPCOMRT_API)
           Maybe<GeckoProfilerTracingRAII> profilerRAII;
           if (profiler_feature_active("restyle")) {
             profilerRAII.emplace("Paint", "Styles", Move(currentRestyle->mBacktrace));
           }
 #endif
           if (isTimelineRecording) {
             UniquePtr<TimelineMarker> marker = MakeUnique<RestyleTimelineMarker>(
-              currentRestyle->mRestyleHint, TRACING_INTERVAL_START);
+              currentRestyle->mRestyleHint, MarkerTracingType::START);
             TimelineConsumers::AddMarkerForDocShell(docShell, Move(marker));
           }
 
           ProcessOneRestyle(currentRestyle->mElement,
                             currentRestyle->mRestyleHint,
                             currentRestyle->mChangeHint,
                             currentRestyle->mRestyleHintData);
 
           if (isTimelineRecording) {
             UniquePtr<TimelineMarker> marker = MakeUnique<RestyleTimelineMarker>(
-              currentRestyle->mRestyleHint, TRACING_INTERVAL_END);
+              currentRestyle->mRestyleHint, MarkerTracingType::END);
             TimelineConsumers::AddMarkerForDocShell(docShell, Move(marker));
           }
         }
       }
     }
   }
 
   // mPendingRestyles is now empty.
--- a/layout/base/nsPresShell.cpp
+++ b/layout/base/nsPresShell.cpp
@@ -8979,17 +8979,17 @@ PresShell::DoReflow(nsIFrame* target, bo
   if (uri)
     uri->GetSpec(docURL);
 
   PROFILER_LABEL_PRINTF("PresShell", "DoReflow",
     js::ProfileEntry::Category::GRAPHICS, "(%s)", docURL.get());
 
   nsDocShell* docShell = static_cast<nsDocShell*>(GetPresContext()->GetDocShell());
   if (docShell) {
-    TimelineConsumers::AddMarkerForDocShell(docShell, "Reflow", TRACING_INTERVAL_START);
+    TimelineConsumers::AddMarkerForDocShell(docShell, "Reflow", MarkerTracingType::START);
   }
 
   if (mReflowContinueTimer) {
     mReflowContinueTimer->Cancel();
     mReflowContinueTimer = nullptr;
   }
 
   nsIFrame* rootFrame = mFrameConstructor->GetRootFrame();
@@ -9156,17 +9156,17 @@ PresShell::DoReflow(nsIFrame* target, bo
       TimeDuration reflowTime = TimeStamp::Now() - timeStart;
       LogTextPerfStats(tp, this, tp->current,
                        reflowTime.ToMilliseconds(), eLog_reflow, nullptr);
     }
     tp->Accumulate();
   }
 
   if (docShell) {
-    TimelineConsumers::AddMarkerForDocShell(docShell, "Reflow", TRACING_INTERVAL_END);
+    TimelineConsumers::AddMarkerForDocShell(docShell, "Reflow", MarkerTracingType::END);
   }
   return !interrupted;
 }
 
 #ifdef DEBUG
 void
 PresShell::DoVerifyReflow()
 {
--- a/layout/base/nsRefreshDriver.cpp
+++ b/layout/base/nsRefreshDriver.cpp
@@ -1703,34 +1703,34 @@ nsRefreshDriver::Tick(int64_t aNowEpoch,
   mPresShellsToInvalidateIfHidden.Clear();
 
   if (mViewManagerFlushIsPending) {
     nsTArray<nsDocShell*> profilingDocShells;
     GetProfileTimelineSubDocShells(GetDocShell(mPresContext), profilingDocShells);
     for (nsDocShell* docShell : profilingDocShells) {
       // For the sake of the profile timeline's simplicity, this is flagged as
       // paint even if it includes creating display lists
-      TimelineConsumers::AddMarkerForDocShell(docShell, "Paint", TRACING_INTERVAL_START);
+      TimelineConsumers::AddMarkerForDocShell(docShell, "Paint",  MarkerTracingType::START);
     }
 #ifdef MOZ_DUMP_PAINTING
     if (nsLayoutUtils::InvalidationDebuggingIsEnabled()) {
       printf_stderr("Starting ProcessPendingUpdates\n");
     }
 #endif
 
     mViewManagerFlushIsPending = false;
     nsRefPtr<nsViewManager> vm = mPresContext->GetPresShell()->GetViewManager();
     vm->ProcessPendingUpdates();
 #ifdef MOZ_DUMP_PAINTING
     if (nsLayoutUtils::InvalidationDebuggingIsEnabled()) {
       printf_stderr("Ending ProcessPendingUpdates\n");
     }
 #endif
     for (nsDocShell* docShell : profilingDocShells) {
-      TimelineConsumers::AddMarkerForDocShell(docShell, "Paint", TRACING_INTERVAL_END);
+      TimelineConsumers::AddMarkerForDocShell(docShell, "Paint",  MarkerTracingType::END);
     }
 
     if (nsContentUtils::XPConnect()) {
       nsContentUtils::XPConnect()->NotifyDidPaint();
       nsJSContext::NotifyDidPaint();
     }
   }
 
--- a/view/nsView.cpp
+++ b/view/nsView.cpp
@@ -1086,19 +1086,19 @@ nsView::DidCompositeWindow(const TimeSta
     // event which wouldn't be terribly useful to display.
     if (aCompositeStart == aCompositeEnd) {
       return;
     }
 
     nsIDocShell* docShell = context->GetDocShell();
 
     TimelineConsumers::AddMarkerForDocShell(docShell,
-      "Composite", aCompositeStart, TRACING_INTERVAL_START);
+      "Composite", aCompositeStart, MarkerTracingType::START);
     TimelineConsumers::AddMarkerForDocShell(docShell,
-      "Composite", aCompositeEnd, TRACING_INTERVAL_END);
+      "Composite", aCompositeEnd, MarkerTracingType::END);
   }
 }
 
 void
 nsView::RequestRepaint()
 {
   nsIPresShell* presShell = mViewManager->GetPresShell();
   if (presShell) {