Bug 1675409 - Migrated TextMarkerPayload to Markers 2.0 API - r=gregtatum

Differential Revision: https://phabricator.services.mozilla.com/D96052
This commit is contained in:
Gerald Squelart
2020-11-18 21:54:13 +00:00
parent e29a741f4f
commit 75c6c9d395
12 changed files with 97 additions and 176 deletions

View File

@@ -24,6 +24,7 @@
#include "js/SourceText.h"
#include "js/Utility.h"
#include "xpcpublic.h"
#include "GeckoProfiler.h"
#include "nsCycleCollectionParticipant.h"
#include "nsIContent.h"
#include "nsJSUtils.h"
@@ -83,10 +84,6 @@
#include "nsIScriptError.h"
#include "nsIAsyncOutputStream.h"
#ifdef MOZ_GECKO_PROFILER
# include "ProfilerMarkerPayload.h"
#endif
using JS::SourceText;
using mozilla::Telemetry::LABELS_DOM_SCRIPT_PRELOAD_RESULT;
@@ -2180,7 +2177,7 @@ NotifyOffThreadScriptLoadCompletedRunnable::Run() {
#ifdef MOZ_GECKO_PROFILER
if (profiler_is_active()) {
const char* scriptSourceString;
ProfilerString8View scriptSourceString;
if (request->IsTextSource()) {
scriptSourceString = "ScriptCompileOffThread";
} else if (request->IsBinASTSource()) {
@@ -2192,10 +2189,11 @@ NotifyOffThreadScriptLoadCompletedRunnable::Run() {
nsAutoCString profilerLabelString;
GetProfilerLabelForRequest(request, profilerLabelString);
PROFILER_ADD_MARKER_WITH_PAYLOAD(
scriptSourceString, JS, TextMarkerPayload,
(profilerLabelString, request->mOffThreadParseStartTime,
request->mOffThreadParseStopTime));
PROFILER_MARKER_TEXT(
scriptSourceString, JS,
MarkerTiming::Interval(request->mOffThreadParseStartTime,
request->mOffThreadParseStopTime),
profilerLabelString);
}
#endif