Bug 1388608: Add profiler labels for dispatching named runnables. r?mstange
MozReview-Commit-ID: 2vmVY38Kdll
--- a/xpcom/threads/nsThread.cpp
+++ b/xpcom/threads/nsThread.cpp
@@ -1436,16 +1436,19 @@ nsThread::ProcessNextEvent(bool aMayWait
// Copy the name into sMainThreadRunnableName's buffer, and append a
// terminating null.
uint32_t length = std::min((uint32_t) kRunnableNameBufSize - 1,
(uint32_t) name.Length());
memcpy(sMainThreadRunnableName.begin(), name.BeginReading(), length);
sMainThreadRunnableName[length] = '\0';
}
+
+ AUTO_PROFILER_LABEL_DYNAMIC("nsThread::ProcessNextEvent", EVENTS,
+ name.get());
#endif
event->Run();
} else if (aMayWait) {
MOZ_ASSERT(ShuttingDown(),
"This should only happen when shutting down");
rv = NS_ERROR_UNEXPECTED;
}