Bug 1470795 Part 5 - Update content parse users for API movement, r=froydnj.

--HG--
extra : rebase_source : 856eecd3568adc9873b899a38ad96bbf24ebe955
This commit is contained in:
Brian Hackett 2018-07-23 21:45:33 +00:00
parent 55d5de3688
commit f594284848
3 changed files with 8 additions and 13 deletions

View File

@ -2362,10 +2362,8 @@ ScriptLoader::EvaluateScript(ScriptLoadRequest* aRequest)
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);
recordreplay::NoteContentParse(this, options.filename(), "application/javascript",
srcBuf.get(), srcBuf.length());
}
rv = exec.CompileAndExec(options, srcBuf, &script);

View File

@ -2221,10 +2221,8 @@ ScriptSource::performXDR(XDRState<mode>* xdr)
ScriptSource::PinnedChars chars(xdr->cx(), this, holder, 0, length());
if (!chars.get())
return xdr->fail(JS::TranscodeResult_Throw);
JS::BeginContentParseForRecordReplay(this, filename(), "application/javascript",
JS::SmallestEncoding::UTF16);
JS::AddContentParseDataForRecordReplay(this, chars.get(), length() * sizeof(char16_t));
JS::EndContentParseForRecordReplay(this);
mozilla::recordreplay::NoteContentParse(this, filename(), "application/javascript",
chars.get(), length());
}
}

View File

@ -220,7 +220,7 @@ nsHtml5StreamParser::~nsHtml5StreamParser()
NS_ASSERTION(NS_IsMainThread(), "Wrong thread!");
mTokenizer->end();
if (recordreplay::IsRecordingOrReplaying()) {
JS::EndContentParseForRecordReplay(this);
recordreplay::EndContentParse(this);
}
#ifdef DEBUG
{
@ -290,8 +290,7 @@ nsHtml5StreamParser::SetViewSourceTitle(nsIURI* aURL)
if (recordreplay::IsRecordingOrReplaying()) {
nsAutoCString spec;
aURL->GetSpec(spec);
JS::BeginContentParseForRecordReplay(this, spec.get(), "text/html",
JS::SmallestEncoding::UTF16);
recordreplay::BeginContentParse(this, spec.get(), "text/html");
}
if (aURL) {
@ -846,7 +845,7 @@ nsHtml5StreamParser::WriteStreamBytes(const uint8_t* aFromSegment,
Tie(result, read, written, hadErrors) =
mUnicodeDecoder->DecodeToUTF16(src, dst, false);
if (recordreplay::IsRecordingOrReplaying()) {
JS::AddContentParseDataForRecordReplay(this, dst.data(), written * sizeof(char16_t));
recordreplay::AddContentParseData(this, dst.data(), written);
}
if (hadErrors && !mHasHadErrors) {
mHasHadErrors = true;
@ -1105,7 +1104,7 @@ nsHtml5StreamParser::DoStopRequest()
Tie(result, read, written, hadErrors) =
mUnicodeDecoder->DecodeToUTF16(src, dst, true);
if (recordreplay::IsRecordingOrReplaying()) {
JS::AddContentParseDataForRecordReplay(this, dst.data(), written * sizeof(char16_t));
recordreplay::AddContentParseData(this, dst.data(), written);
}
if (hadErrors && !mHasHadErrors) {
mHasHadErrors = true;