Bug 1742437 - move DOM script context into own file and rename it; r=jonco

Differential Revision: https://phabricator.services.mozilla.com/D138132
This commit is contained in:
Yulia Startsev
2022-02-17 15:57:51 +00:00
parent fce4457549
commit e92cc07dad
10 changed files with 495 additions and 409 deletions

View File

@@ -623,8 +623,8 @@ nsresult ScriptLoader::StartLoadInternal(ScriptLoadRequest* aRequest,
// this request be processed ahead of other Unblocked requests, but with
// the same weight as Leaders. This will make us behave similar way for
// both http2 and http1.
DOMScriptLoadContext::PrioritizeAsPreload(channel);
DOMScriptLoadContext::AddLoadBackgroundFlag(channel);
ScriptLoadContext::PrioritizeAsPreload(channel);
ScriptLoadContext::AddLoadBackgroundFlag(channel);
} else if (nsCOMPtr<nsIClassOfService> cos = do_QueryInterface(channel)) {
if (aRequest->GetLoadContext()->mScriptFromHead &&
aRequest->GetLoadContext()->IsBlockingScript()) {
@@ -777,7 +777,7 @@ already_AddRefed<ScriptLoadRequest> ScriptLoader::CreateLoadRequest(
nsCOMPtr<Element> domElement = do_QueryInterface(aElement);
RefPtr<ScriptFetchOptions> fetchOptions =
new ScriptFetchOptions(aCORSMode, aReferrerPolicy, aTriggeringPrincipal);
RefPtr<DOMScriptLoadContext> context = new DOMScriptLoadContext(domElement);
RefPtr<ScriptLoadContext> context = new ScriptLoadContext(domElement);
if (aKind == ScriptKind::eClassic) {
RefPtr<ScriptLoadRequest> aRequest = new ScriptLoadRequest(