Backed out 13 changesets (bug 1771867) for causing CanonicalBrowsingContext crashes. CLOSED TREE
Backed out changeset 120838b58449 (bug 1771867) Backed out changeset aea7ca0bbd17 (bug 1771867) Backed out changeset 2fe2afdee09d (bug 1771867) Backed out changeset 8bdb1f682d22 (bug 1771867) Backed out changeset a9f3158ed688 (bug 1771867) Backed out changeset 1177913e1edf (bug 1771867) Backed out changeset d33ccbbf407d (bug 1771867) Backed out changeset 110ac12e16f5 (bug 1771867) Backed out changeset 7f20525f5e94 (bug 1771867) Backed out changeset b3d65b1aa872 (bug 1771867) Backed out changeset 7cdf3cef2773 (bug 1771867) Backed out changeset 5090eae24a5c (bug 1771867) Backed out changeset f8a03d226c73 (bug 1771867)
This commit is contained in:
@@ -9,7 +9,6 @@
|
||||
#include "ScriptTrace.h"
|
||||
#include "ModuleLoader.h"
|
||||
|
||||
#include "nsIChildChannel.h"
|
||||
#include "zlib.h"
|
||||
|
||||
#include "prsystem.h"
|
||||
@@ -520,7 +519,7 @@ nsresult ScriptLoader::RestartLoad(ScriptLoadRequest* aRequest) {
|
||||
if (aRequest->IsModuleRequest()) {
|
||||
rv = aRequest->AsModuleRequest()->RestartModuleLoad();
|
||||
} else {
|
||||
rv = StartLoad(aRequest, 0);
|
||||
rv = StartLoad(aRequest);
|
||||
}
|
||||
if (NS_FAILED(rv)) {
|
||||
return rv;
|
||||
@@ -531,17 +530,15 @@ nsresult ScriptLoader::RestartLoad(ScriptLoadRequest* aRequest) {
|
||||
return NS_BINDING_RETARGETED;
|
||||
}
|
||||
|
||||
nsresult ScriptLoader::StartLoad(ScriptLoadRequest* aRequest,
|
||||
uint64_t aEarlyHintPreloaderId) {
|
||||
nsresult ScriptLoader::StartLoad(ScriptLoadRequest* aRequest) {
|
||||
if (aRequest->IsModuleRequest()) {
|
||||
return aRequest->AsModuleRequest()->StartModuleLoad();
|
||||
}
|
||||
|
||||
return StartClassicLoad(aRequest, aEarlyHintPreloaderId);
|
||||
return StartClassicLoad(aRequest);
|
||||
}
|
||||
|
||||
nsresult ScriptLoader::StartClassicLoad(ScriptLoadRequest* aRequest,
|
||||
uint64_t aEarlyHintPreloaderId) {
|
||||
nsresult ScriptLoader::StartClassicLoad(ScriptLoadRequest* aRequest) {
|
||||
MOZ_ASSERT(aRequest->IsFetching());
|
||||
NS_ENSURE_TRUE(mDocument, NS_ERROR_NULL_POINTER);
|
||||
aRequest->SetUnknownDataType();
|
||||
@@ -565,8 +562,7 @@ nsresult ScriptLoader::StartClassicLoad(ScriptLoadRequest* aRequest,
|
||||
|
||||
securityFlags |= nsILoadInfo::SEC_ALLOW_CHROME;
|
||||
|
||||
nsresult rv =
|
||||
StartLoadInternal(aRequest, securityFlags, aEarlyHintPreloaderId);
|
||||
nsresult rv = StartLoadInternal(aRequest, securityFlags);
|
||||
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
@@ -584,8 +580,7 @@ static bool IsWebExtensionRequest(ScriptLoadRequest* aRequest) {
|
||||
}
|
||||
|
||||
nsresult ScriptLoader::StartLoadInternal(ScriptLoadRequest* aRequest,
|
||||
nsSecurityFlags securityFlags,
|
||||
uint64_t aEarlyHintPreloaderId) {
|
||||
nsSecurityFlags securityFlags) {
|
||||
nsContentPolicyType contentPolicyType =
|
||||
ScriptLoadRequestToContentPolicyType(aRequest);
|
||||
nsCOMPtr<nsINode> context;
|
||||
@@ -611,15 +606,6 @@ nsresult ScriptLoader::StartLoadInternal(ScriptLoadRequest* aRequest,
|
||||
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
if (aEarlyHintPreloaderId) {
|
||||
nsCOMPtr<nsIHttpChannelInternal> channelInternal =
|
||||
do_QueryInterface(channel);
|
||||
NS_ENSURE_TRUE(channelInternal != nullptr, NS_ERROR_FAILURE);
|
||||
|
||||
rv = channelInternal->SetEarlyHintPreloaderId(aEarlyHintPreloaderId);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
}
|
||||
|
||||
// snapshot the nonce at load start time for performing CSP checks
|
||||
if (contentPolicyType == nsIContentPolicy::TYPE_INTERNAL_SCRIPT ||
|
||||
contentPolicyType == nsIContentPolicy::TYPE_INTERNAL_MODULE) {
|
||||
@@ -741,9 +727,7 @@ nsresult ScriptLoader::StartLoadInternal(ScriptLoadRequest* aRequest,
|
||||
// Set the initiator type
|
||||
nsCOMPtr<nsITimedChannel> timedChannel(do_QueryInterface(httpChannel));
|
||||
if (timedChannel) {
|
||||
if (aEarlyHintPreloaderId) {
|
||||
timedChannel->SetInitiatorType(u"early-hints"_ns);
|
||||
} else if (aRequest->GetScriptLoadContext()->IsLinkPreloadScript()) {
|
||||
if (aRequest->GetScriptLoadContext()->IsLinkPreloadScript()) {
|
||||
timedChannel->SetInitiatorType(u"link"_ns);
|
||||
} else {
|
||||
timedChannel->SetInitiatorType(u"script"_ns);
|
||||
@@ -773,14 +757,6 @@ nsresult ScriptLoader::StartLoadInternal(ScriptLoadRequest* aRequest,
|
||||
key, channel, mDocument,
|
||||
aRequest->GetScriptLoadContext()->IsLinkPreloadScript());
|
||||
|
||||
if (aEarlyHintPreloaderId) {
|
||||
nsCOMPtr<nsIHttpChannelInternal> channelInternal =
|
||||
do_QueryInterface(channel);
|
||||
NS_ENSURE_TRUE(channelInternal != nullptr, NS_ERROR_FAILURE);
|
||||
|
||||
rv = channelInternal->SetEarlyHintPreloaderId(aEarlyHintPreloaderId);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
}
|
||||
rv = channel->AsyncOpen(loader);
|
||||
|
||||
if (NS_FAILED(rv)) {
|
||||
@@ -1026,7 +1002,7 @@ bool ScriptLoader::ProcessExternalScript(nsIScriptElement* aElement,
|
||||
LOG(("ScriptLoadRequest (%p): Created request for external script",
|
||||
request.get()));
|
||||
|
||||
nsresult rv = StartLoad(request, 0);
|
||||
nsresult rv = StartLoad(request);
|
||||
if (NS_FAILED(rv)) {
|
||||
ReportErrorToConsole(request, rv);
|
||||
|
||||
@@ -3560,8 +3536,7 @@ void ScriptLoader::PreloadURI(nsIURI* aURI, const nsAString& aCharset,
|
||||
const nsAString& aIntegrity, bool aScriptFromHead,
|
||||
bool aAsync, bool aDefer, bool aNoModule,
|
||||
bool aLinkPreload,
|
||||
const ReferrerPolicy aReferrerPolicy,
|
||||
uint64_t aEarlyHintPreloaderId) {
|
||||
const ReferrerPolicy aReferrerPolicy) {
|
||||
NS_ENSURE_TRUE_VOID(mDocument);
|
||||
// Check to see if scripts has been turned off.
|
||||
if (!mEnabled || !mDocument->IsScriptEnabled()) {
|
||||
@@ -3609,7 +3584,7 @@ void ScriptLoader::PreloadURI(nsIURI* aURI, const nsAString& aCharset,
|
||||
request.get(), url.get()));
|
||||
}
|
||||
|
||||
nsresult rv = StartLoad(request, aEarlyHintPreloaderId);
|
||||
nsresult rv = StartLoad(request);
|
||||
if (NS_FAILED(rv)) {
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user