Bug 1326524 - Unbreak build without SPS profiler after bug 1324941. r?mstange draft
authorJan Beich <jbeich@FreeBSD.org>
Sat, 31 Dec 2016 08:27:27 +0000
changeset 455011 81e4c09a49076aab25bae74099a2b2972713ed5d
parent 455010 81463aec62d02fa1915e03cda7a8ddc8d44c71fc
child 540872 2aa7dcb662917b1d8431ab92ac42bdbd1071d04a
push id40111
push userbmo:jbeich@FreeBSD.org
push dateSat, 31 Dec 2016 08:31:05 +0000
reviewersmstange
bugs1326524, 1324941
milestone53.0a1
Bug 1326524 - Unbreak build without SPS profiler after bug 1324941. r?mstange MozReview-Commit-ID: 2E4MlCLQ9lf
dom/events/EventListenerManager.cpp
--- a/dom/events/EventListenerManager.cpp
+++ b/dom/events/EventListenerManager.cpp
@@ -28,17 +28,19 @@
 #include "mozilla/dom/EventTargetBinding.h"
 #include "mozilla/dom/TouchEvent.h"
 #include "mozilla/TimelineConsumers.h"
 #include "mozilla/EventTimelineMarker.h"
 #include "mozilla/TimeStamp.h"
 
 #include "EventListenerService.h"
 #include "GeckoProfiler.h"
+#ifdef MOZ_ENABLE_PROFILER_SPS
 #include "ProfilerMarkers.h"
+#endif
 #include "nsCOMArray.h"
 #include "nsCOMPtr.h"
 #include "nsContentUtils.h"
 #include "nsDOMCID.h"
 #include "nsError.h"
 #include "nsGkAtoms.h"
 #include "nsHtml5Atoms.h"
 #include "nsIContent.h"
@@ -1282,16 +1284,17 @@ EventListenerManager::HandleEventInterna
               // called again inside the listener.
               listenerHolder.emplace(Move(*listener));
               listener = listenerHolder.ptr();
               hasRemovedListener = true;
             }
 
             nsresult rv = NS_OK;
             if (profiler_is_active()) {
+#ifdef MOZ_ENABLE_PROFILER_SPS
               // Add a profiler label and a profiler marker for the actual
               // dispatch of the event.
               // This is a very hot code path, so we need to make sure not to
               // do this extra work when we're not profiling.
               nsAutoString typeStr;
               (*aDOMEvent)->GetType(typeStr);
               PROFILER_LABEL_PRINTF("EventListenerManager", "HandleEventInternal",
                                     js::ProfileEntry::Category::EVENTS,
@@ -1303,16 +1306,19 @@ EventListenerManager::HandleEventInterna
 
               TimeStamp endTime = TimeStamp::Now();
               uint16_t phase;
               (*aDOMEvent)->GetEventPhase(&phase);
               PROFILER_MARKER_PAYLOAD("DOMEvent",
                                       new DOMEventMarkerPayload(typeStr, phase,
                                                                 startTime,
                                                                 endTime));
+#else
+              MOZ_CRASH("SPS profiler is N/A but profiler_is_active() returned true");
+#endif
             } else {
               rv = HandleEventSubType(listener, *aDOMEvent, aCurrentTarget);
             }
 
             if (NS_FAILED(rv)) {
               aEvent->mFlags.mExceptionWasRaised = true;
             }
             aEvent->mFlags.mInPassiveListener = false;