Backed out changeset 59a45d8c0fbb (bug 1635365) for browser-chrome failures on browser_bug902156.js. CLOSED TREE

This commit is contained in:
Csoregi Natalia 2020-05-08 19:09:20 +03:00
Родитель 2e71833471
Коммит cd28d94be1
7 изменённых файлов: 21 добавлений и 22 удалений

Просмотреть файл

@ -1921,6 +1921,11 @@ bool BrowsingContext::CanSet(FieldIndex<IDX_AllowPlugins>,
return CheckOnlyOwningProcessCanSet(aSource);
}
bool BrowsingContext::CanSet(FieldIndex<IDX_IsSecure>, const bool& aIsSecure,
ContentParent* aSource) {
return CheckOnlyOwningProcessCanSet(aSource);
}
bool BrowsingContext::CanSet(FieldIndex<IDX_WatchedByDevtools>,
const bool& aWatchedByDevtools,
ContentParent* aSource) {

Просмотреть файл

@ -133,7 +133,10 @@ class WindowProxyHolder;
FIELD(WatchedByDevtools, bool) \
FIELD(TextZoom, float) \
/* See nsIRequest for possible flags. */ \
FIELD(DefaultLoadFlags, uint32_t)
FIELD(DefaultLoadFlags, uint32_t) \
/* Mixed-Content: If the corresponding documentURI is https, \
* then this flag is true. */ \
FIELD(IsSecure, bool)
// BrowsingContext, in this context, is the cross process replicated
// environment in which information about documents is stored. In
@ -725,6 +728,8 @@ class BrowsingContext : public nsILoadContext, public nsWrapperCache {
ContentParent* aSource);
bool CanSet(FieldIndex<IDX_AllowPlugins>, const bool& aAllowPlugins,
ContentParent* aSource);
bool CanSet(FieldIndex<IDX_IsSecure>, const bool& aIsSecure,
ContentParent* aSource);
bool CanSet(FieldIndex<IDX_WatchedByDevtools>, const bool& aWatchedByDevtools,
ContentParent* aSource);

Просмотреть файл

@ -120,15 +120,6 @@ bool WindowContext::CheckOnlyOwningProcessCanSet(ContentParent* aSource) {
return false;
}
bool WindowContext::CanSet(FieldIndex<IDX_IsSecure>, const bool& aIsSecure,
ContentParent* aSource) {
// reject attempts to set isSecure for mixed content from a content process
if (XRE_IsContentProcess() || aSource) {
return false;
}
return true;
}
bool WindowContext::CanSet(FieldIndex<IDX_AllowMixedContent>,
const bool& aAllowMixedContent,
ContentParent* aSource) {

Просмотреть файл

@ -26,9 +26,6 @@ class WindowGlobalParent;
/* Whether this window's channel has been marked as a third-party \
* tracking resource */ \
FIELD(IsThirdPartyTrackingResourceWindow, bool) \
/* Mixed-Content: If the corresponding documentURI is https, \
* then this flag is true. */ \
FIELD(IsSecure, bool) \
/* Whether the user has overriden the mixed content blocker to allow \
* mixed content loads to happen */ \
FIELD(AllowMixedContent, bool)
@ -116,8 +113,6 @@ class WindowContext : public nsISupports, public nsWrapperCache {
return GetOuterWindowId() == 0 && aValue != 0;
}
bool CanSet(FieldIndex<IDX_IsSecure>, const bool& aIsSecure,
ContentParent* aSource);
bool CanSet(FieldIndex<IDX_AllowMixedContent>, const bool& aAllowMixedContent,
ContentParent* aSource);

Просмотреть файл

@ -3607,6 +3607,14 @@ void Document::SetDocumentURI(nsIURI* aURI) {
if (inner && inner->GetWindowGlobalChild()) {
inner->GetWindowGlobalChild()->SetDocumentURI(mDocumentURI);
}
auto* browsingContext = GetBrowsingContext();
if (browsingContext) {
nsCOMPtr<nsIURI> innerDocURI = NS_GetInnermostURI(mDocumentURI);
if (innerDocURI) {
browsingContext->SetIsSecure(innerDocURI->SchemeIs("https"));
}
}
}
static void GetFormattedTimeString(PRTime aTime,

Просмотреть файл

@ -250,11 +250,6 @@ IPCResult WindowGlobalParent::RecvUpdateDocumentURI(nsIURI* aURI) {
// XXX(nika): Assert that the URI change was one which makes sense (either
// about:blank -> a real URI, or a legal push/popstate URI change?)
mDocumentURI = aURI;
// Update Mixed Content fields
nsCOMPtr<nsIURI> innerDocURI = NS_GetInnermostURI(mDocumentURI);
if (innerDocURI) {
WindowContext::SetIsSecure(innerDocURI->SchemeIs("https"));
}
return IPC_OK();
}

Просмотреть файл

@ -837,7 +837,7 @@ nsresult nsMixedContentBlocker::ShouldLoad(bool aHadInsecureImageRedirect,
// Determine if the rootDoc is https and if the user decided to allow Mixed
// Content
WindowContext* topWC = requestingWindow->TopWindowContext();
bool rootHasSecureConnection = topWC->GetIsSecure();
bool rootHasSecureConnection = topWC->GetBrowsingContext()->GetIsSecure();
bool allowMixedContent = topWC->GetAllowMixedContent();
// When navigating an iframe, the iframe may be https
@ -848,7 +848,7 @@ nsresult nsMixedContentBlocker::ShouldLoad(bool aHadInsecureImageRedirect,
RefPtr<WindowContext> curWindow = requestingWindow;
while (!httpsParentExists && curWindow) {
httpsParentExists = curWindow->GetIsSecure();
httpsParentExists = curWindow->GetBrowsingContext()->GetIsSecure();
curWindow = curWindow->GetParentWindowContext();
}