Bug 1326524 - Unbreak build without SPS profiler after
bug 1324941. r?mstange
MozReview-Commit-ID: 2E4MlCLQ9lf
--- 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;