From 06d1d0dddb5b7f79a92546e250e533a030f30e93 Mon Sep 17 00:00:00 2001 From: Brian Hackett Date: Mon, 23 Jul 2018 21:42:20 +0000 Subject: [PATCH] Bug 1465292 Part 3 - Track parsed content from loaded script files, r=smaug. --HG-- extra : rebase_source : 6ccda629306428c65eb4d2e912b5ee41b91019bf --- dom/script/ScriptLoader.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/dom/script/ScriptLoader.cpp b/dom/script/ScriptLoader.cpp index 47b4404f2709..2372feb153bd 100644 --- a/dom/script/ScriptLoader.cpp +++ b/dom/script/ScriptLoader.cpp @@ -2360,6 +2360,14 @@ ScriptLoader::EvaluateScript(ScriptLoadRequest* aRequest) MOZ_ASSERT(aRequest->IsTextSource()); nsAutoString inlineData; SourceBufferHolder srcBuf = GetScriptSource(aRequest, inlineData); + + if (recordreplay::IsRecordingOrReplaying()) { + JS::BeginContentParseForRecordReplay(this, options.filename(), "application/javascript", + JS::SmallestEncoding::UTF16); + JS::AddContentParseDataForRecordReplay(this, srcBuf.get(), srcBuf.length() * sizeof(char16_t)); + JS::EndContentParseForRecordReplay(this); + } + rv = exec.CompileAndExec(options, srcBuf, &script); } }