зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1620107 - P1: Remove hasNonEmptySandboxingFlags from DocumentChannelCreationArgs. r=mattwoodrow,nika
Differential Revision: https://phabricator.services.mozilla.com/D65431 --HG-- extra : moz-landing-system : lando
This commit is contained in:
Родитель
442ce3a06e
Коммит
b5bd2e5db0
|
@ -302,6 +302,18 @@ static void DecreasePrivateDocShellCount() {
|
|||
}
|
||||
}
|
||||
|
||||
static bool HasNonEmptySandboxingFlags(nsILoadInfo* aLoadInfo) {
|
||||
// NOTE: HasNonEmptySandboxingFlag used to come from
|
||||
// nsDocShell::mBrowsingContext. nsDocShell::OpenInitializedChannel sets the
|
||||
// mBrowsingContext->ID() to BrowsingContextID/FrameBrowsingContextID
|
||||
// depending on the value of loadInfo->GetExternalContextPolicyType(). Use
|
||||
// GetTargetBrowsingContext() to retrieve nsDocShell::mBrowsingContext.
|
||||
|
||||
RefPtr<BrowsingContext> bc;
|
||||
MOZ_ALWAYS_SUCCEEDS(aLoadInfo->GetTargetBrowsingContext(getter_AddRefs(bc)));
|
||||
return bc && bc->GetSandboxFlags() != 0;
|
||||
}
|
||||
|
||||
nsDocShell::nsDocShell(BrowsingContext* aBrowsingContext,
|
||||
uint64_t aContentWindowID)
|
||||
: nsDocLoader(),
|
||||
|
@ -9372,7 +9384,9 @@ static bool SchemeUsesDocChannel(nsIURI* aURI) {
|
|||
nsIInterfaceRequestor* aCallbacks, nsDocShell* aDocShell,
|
||||
const OriginAttributes& aOriginAttributes, nsLoadFlags aLoadFlags,
|
||||
uint32_t aLoadType, uint32_t aCacheKey, bool aIsActive, bool aIsTopLevelDoc,
|
||||
bool aHasNonEmptySandboxingFlags, nsresult& aRv, nsIChannel** aChannel) {
|
||||
nsresult& aRv, nsIChannel** aChannel) {
|
||||
MOZ_ASSERT(aLoadInfo);
|
||||
|
||||
nsString srcdoc = VoidString();
|
||||
bool isSrcdoc = aLoadState->HasLoadFlags(INTERNAL_LOAD_FLAGS_IS_SRCDOC);
|
||||
if (isSrcdoc) {
|
||||
|
@ -9620,10 +9634,8 @@ static bool SchemeUsesDocChannel(nsIURI* aURI) {
|
|||
}
|
||||
}
|
||||
|
||||
if (aHasNonEmptySandboxingFlags) {
|
||||
if (httpChannelInternal) {
|
||||
httpChannelInternal->SetHasNonEmptySandboxingFlag(true);
|
||||
}
|
||||
if (httpChannelInternal && HasNonEmptySandboxingFlags(aLoadInfo)) {
|
||||
httpChannelInternal->SetHasNonEmptySandboxingFlag(true);
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIURI> rpURI;
|
||||
|
@ -9937,14 +9949,13 @@ nsresult nsDocShell::DoURILoad(nsDocShellLoadState* aLoadState,
|
|||
|
||||
if (StaticPrefs::browser_tabs_documentchannel() && XRE_IsContentProcess() &&
|
||||
canUseDocumentChannel) {
|
||||
channel = new DocumentChannelChild(aLoadState, loadInfo, loadFlags,
|
||||
mLoadType, cacheKey, isActive,
|
||||
isTopLevelDoc, sandboxFlags);
|
||||
channel =
|
||||
new DocumentChannelChild(aLoadState, loadInfo, loadFlags, mLoadType,
|
||||
cacheKey, isActive, isTopLevelDoc);
|
||||
channel->SetNotificationCallbacks(this);
|
||||
} else if (!CreateAndConfigureRealChannelForLoadState(
|
||||
aLoadState, loadInfo, this, this, GetOriginAttributes(),
|
||||
loadFlags, mLoadType, cacheKey, isActive, isTopLevelDoc,
|
||||
mBrowsingContext->GetSandboxFlags(), rv,
|
||||
loadFlags, mLoadType, cacheKey, isActive, isTopLevelDoc, rv,
|
||||
getter_AddRefs(channel))) {
|
||||
return rv;
|
||||
}
|
||||
|
|
|
@ -503,8 +503,7 @@ class nsDocShell final : public nsDocLoader,
|
|||
nsIInterfaceRequestor* aCallbacks, nsDocShell* aDocShell,
|
||||
const mozilla::OriginAttributes& aOriginAttributes,
|
||||
nsLoadFlags aLoadFlags, uint32_t aLoadType, uint32_t aCacheKey,
|
||||
bool aIsActive, bool aIsTopLevelDoc, bool aHasNonEmptySandboxingFlags,
|
||||
nsresult& rv, nsIChannel** aChannel);
|
||||
bool aIsActive, bool aIsTopLevelDoc, nsresult& rv, nsIChannel** aChannel);
|
||||
|
||||
// Notify consumers of a search being loaded through the observer service:
|
||||
static void MaybeNotifyKeywordSearchLoading(const nsString& aProvider,
|
||||
|
|
|
@ -57,15 +57,13 @@ DocumentChannel::DocumentChannel(nsDocShellLoadState* aLoadState,
|
|||
net::LoadInfo* aLoadInfo,
|
||||
nsLoadFlags aLoadFlags, uint32_t aLoadType,
|
||||
uint32_t aCacheKey, bool aIsActive,
|
||||
bool aIsTopLevelDoc,
|
||||
bool aHasNonEmptySandboxingFlags)
|
||||
bool aIsTopLevelDoc)
|
||||
: mAsyncOpenTime(TimeStamp::Now()),
|
||||
mLoadState(aLoadState),
|
||||
mLoadType(aLoadType),
|
||||
mCacheKey(aCacheKey),
|
||||
mIsActive(aIsActive),
|
||||
mIsTopLevelDoc(aIsTopLevelDoc),
|
||||
mHasNonEmptySandboxingFlags(aHasNonEmptySandboxingFlags),
|
||||
mLoadFlags(aLoadFlags),
|
||||
mURI(aLoadState->URI()),
|
||||
mLoadInfo(aLoadInfo) {
|
||||
|
|
|
@ -47,8 +47,7 @@ class DocumentChannel : public nsIIdentChannel, public nsITraceableChannel {
|
|||
|
||||
DocumentChannel(nsDocShellLoadState* aLoadState, class LoadInfo* aLoadInfo,
|
||||
nsLoadFlags aLoadFlags, uint32_t aLoadType,
|
||||
uint32_t aCacheKey, bool aIsActive, bool aIsTopLevelDoc,
|
||||
bool aHasNonEmptySandboxingFlags);
|
||||
uint32_t aCacheKey, bool aIsActive, bool aIsTopLevelDoc);
|
||||
|
||||
const nsTArray<DocumentChannelRedirect>& GetRedirectChain() const {
|
||||
return mRedirects;
|
||||
|
@ -86,7 +85,6 @@ class DocumentChannel : public nsIIdentChannel, public nsITraceableChannel {
|
|||
const uint32_t mCacheKey;
|
||||
const bool mIsActive;
|
||||
const bool mIsTopLevelDoc;
|
||||
const bool mHasNonEmptySandboxingFlags;
|
||||
|
||||
nsresult mStatus = NS_OK;
|
||||
bool mCanceled = false;
|
||||
|
|
|
@ -26,12 +26,14 @@ NS_INTERFACE_MAP_END_INHERITING(DocumentChannel)
|
|||
NS_IMPL_ADDREF_INHERITED(DocumentChannelChild, DocumentChannel)
|
||||
NS_IMPL_RELEASE_INHERITED(DocumentChannelChild, DocumentChannel)
|
||||
|
||||
DocumentChannelChild::DocumentChannelChild(
|
||||
nsDocShellLoadState* aLoadState, net::LoadInfo* aLoadInfo,
|
||||
nsLoadFlags aLoadFlags, uint32_t aLoadType, uint32_t aCacheKey,
|
||||
bool aIsActive, bool aIsTopLevelDoc, bool aHasNonEmptySandboxingFlags)
|
||||
DocumentChannelChild::DocumentChannelChild(nsDocShellLoadState* aLoadState,
|
||||
net::LoadInfo* aLoadInfo,
|
||||
nsLoadFlags aLoadFlags,
|
||||
uint32_t aLoadType,
|
||||
uint32_t aCacheKey, bool aIsActive,
|
||||
bool aIsTopLevelDoc)
|
||||
: DocumentChannel(aLoadState, aLoadInfo, aLoadFlags, aLoadType, aCacheKey,
|
||||
aIsActive, aIsTopLevelDoc, aHasNonEmptySandboxingFlags) {
|
||||
aIsActive, aIsTopLevelDoc) {
|
||||
LOG(("DocumentChannelChild ctor [this=%p, uri=%s]", this,
|
||||
aLoadState->URI()->GetSpecOrDefault().get()));
|
||||
}
|
||||
|
@ -88,7 +90,6 @@ DocumentChannelChild::AsyncOpen(nsIStreamListener* aListener) {
|
|||
args.cacheKey() = mCacheKey;
|
||||
args.isActive() = mIsActive;
|
||||
args.isTopLevelDoc() = mIsTopLevelDoc;
|
||||
args.hasNonEmptySandboxingFlags() = mHasNonEmptySandboxingFlags;
|
||||
args.channelId() = mChannelId;
|
||||
args.asyncOpenTime() = mAsyncOpenTime;
|
||||
args.documentOpenFlags() = mDocumentOpenFlags;
|
||||
|
|
|
@ -27,7 +27,7 @@ class DocumentChannelChild final : public DocumentChannel,
|
|||
DocumentChannelChild(nsDocShellLoadState* aLoadState,
|
||||
class LoadInfo* aLoadInfo, nsLoadFlags aLoadFlags,
|
||||
uint32_t aLoadType, uint32_t aCacheKey, bool aIsActive,
|
||||
bool aIsTopLevelDoc, bool aHasNonEmptySandboxingFlags);
|
||||
bool aIsTopLevelDoc);
|
||||
|
||||
NS_DECL_ISUPPORTS_INHERITED
|
||||
NS_DECL_NSIASYNCVERIFYREDIRECTCALLBACK
|
||||
|
|
|
@ -55,10 +55,10 @@ bool DocumentChannelParent::Init(const DocumentChannelCreationArgs& aArgs) {
|
|||
rv = NS_ERROR_UNEXPECTED;
|
||||
if (!mParent->Open(loadState, loadInfo, aArgs.loadFlags(), aArgs.loadType(),
|
||||
aArgs.cacheKey(), aArgs.isActive(), aArgs.isTopLevelDoc(),
|
||||
aArgs.hasNonEmptySandboxingFlags(), aArgs.channelId(),
|
||||
aArgs.asyncOpenTime(), aArgs.documentOpenFlags(),
|
||||
aArgs.pluginsAllowed(), aArgs.timing().refOr(nullptr),
|
||||
std::move(clientInfo), aArgs.outerWindowId(), &rv)) {
|
||||
aArgs.channelId(), aArgs.asyncOpenTime(),
|
||||
aArgs.documentOpenFlags(), aArgs.pluginsAllowed(),
|
||||
aArgs.timing().refOr(nullptr), std::move(clientInfo),
|
||||
aArgs.outerWindowId(), &rv)) {
|
||||
return SendFailedAsyncOpen(rv);
|
||||
}
|
||||
|
||||
|
|
|
@ -346,11 +346,10 @@ CanonicalBrowsingContext* DocumentLoadListener::GetBrowsingContext() {
|
|||
bool DocumentLoadListener::Open(
|
||||
nsDocShellLoadState* aLoadState, class LoadInfo* aLoadInfo,
|
||||
nsLoadFlags aLoadFlags, uint32_t aLoadType, uint32_t aCacheKey,
|
||||
bool aIsActive, bool aIsTopLevelDoc, bool aHasNonEmptySandboxingFlags,
|
||||
const uint64_t& aChannelId, const TimeStamp& aAsyncOpenTime,
|
||||
const Maybe<uint32_t>& aDocumentOpenFlags, bool aPluginsAllowed,
|
||||
nsDOMNavigationTiming* aTiming, Maybe<ClientInfo>&& aInfo,
|
||||
uint64_t aOuterWindowId, nsresult* aRv) {
|
||||
bool aIsActive, bool aIsTopLevelDoc, const uint64_t& aChannelId,
|
||||
const TimeStamp& aAsyncOpenTime, const Maybe<uint32_t>& aDocumentOpenFlags,
|
||||
bool aPluginsAllowed, nsDOMNavigationTiming* aTiming,
|
||||
Maybe<ClientInfo>&& aInfo, uint64_t aOuterWindowId, nsresult* aRv) {
|
||||
LOG(("DocumentLoadListener Open [this=%p, uri=%s]", this,
|
||||
aLoadState->URI()->GetSpecOrDefault().get()));
|
||||
RefPtr<CanonicalBrowsingContext> browsingContext =
|
||||
|
@ -375,8 +374,8 @@ bool DocumentLoadListener::Open(
|
|||
|
||||
if (!nsDocShell::CreateAndConfigureRealChannelForLoadState(
|
||||
aLoadState, loadInfo, mParentChannelListener, nullptr, attrs,
|
||||
aLoadFlags, aLoadType, aCacheKey, aIsActive, aIsTopLevelDoc,
|
||||
aHasNonEmptySandboxingFlags, *aRv, getter_AddRefs(mChannel))) {
|
||||
aLoadFlags, aLoadType, aCacheKey, aIsActive, aIsTopLevelDoc, *aRv,
|
||||
getter_AddRefs(mChannel))) {
|
||||
mParentChannelListener = nullptr;
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -69,10 +69,9 @@ class DocumentLoadListener : public nsIInterfaceRequestor,
|
|||
ADocumentChannelBridge* aBridge);
|
||||
|
||||
// Creates the channel, and then calls AsyncOpen on it.
|
||||
bool Open(nsDocShellLoadState* aLoadState, class LoadInfo* aLoadInfo,
|
||||
bool Open(nsDocShellLoadState* aLoadState, LoadInfo* aLoadInfo,
|
||||
nsLoadFlags aLoadFlags, uint32_t aLoadType, uint32_t aCacheKey,
|
||||
bool aIsActive, bool aIsTopLevelDoc,
|
||||
bool aHasNonEmptySandboxingFlags, const uint64_t& aChannelId,
|
||||
bool aIsActive, bool aIsTopLevelDoc, const uint64_t& aChannelId,
|
||||
const TimeStamp& aAsyncOpenTime,
|
||||
const Maybe<uint32_t>& aDocumentOpenFlags, bool aPluginsAllowed,
|
||||
nsDOMNavigationTiming* aTiming, Maybe<dom::ClientInfo>&& aInfo,
|
||||
|
|
|
@ -418,7 +418,6 @@ struct DocumentChannelCreationArgs {
|
|||
uint32_t? documentOpenFlags;
|
||||
bool isActive;
|
||||
bool isTopLevelDoc;
|
||||
bool hasNonEmptySandboxingFlags;
|
||||
bool pluginsAllowed;
|
||||
nsDOMNavigationTiming? timing;
|
||||
IPCClientInfo? initialClientInfo;
|
||||
|
|
Загрузка…
Ссылка в новой задаче