Backed out 10 changesets (bug 1614462) for causing test_ipc_messagemanager_blob.js failures CLOSED TREE

Backed out changeset bf4f8253c708 (bug 1614462)
Backed out changeset c61b797d63e9 (bug 1614462)
Backed out changeset 284002de7137 (bug 1614462)
Backed out changeset 7f604ee5731c (bug 1614462)
Backed out changeset a73ef8167cd4 (bug 1614462)
Backed out changeset ecc3477ed34e (bug 1614462)
Backed out changeset 2106f3ccc4b5 (bug 1614462)
Backed out changeset e68c38a7741d (bug 1614462)
Backed out changeset 93b3bacdbb34 (bug 1614462)
Backed out changeset 0cf4898ae08d (bug 1614462)
This commit is contained in:
Ciure Andrei
2020-04-21 01:11:37 +03:00
parent 0ef155c628
commit 9957be4184
260 changed files with 9434 additions and 1518 deletions

View File

@@ -354,6 +354,7 @@ nsDocShell::nsDocShell(BrowsingContext* aBrowsingContext,
mLoadType(0),
mDefaultLoadFlags(nsIRequest::LOAD_NORMAL),
mFailedLoadType(0),
mFrameType(FRAME_TYPE_REGULAR),
mDisplayMode(nsIDocShell::DISPLAY_MODE_BROWSER),
mJSRunToCompletionDepth(0),
mTouchEventsOverride(nsIDocShell::TOUCHEVENTS_OVERRIDE_NONE),
@@ -1846,6 +1847,21 @@ nsDocShell::GetFullscreenAllowed(bool* aFullscreenAllowed) {
return parent->GetFullscreenAllowed(aFullscreenAllowed);
}
NS_IMETHODIMP
nsDocShell::SetFullscreenAllowed(bool aFullscreenAllowed) {
if (!nsIDocShell::GetIsMozBrowser()) {
// Only allow setting of fullscreenAllowed on content/process boundaries.
// At non-boundaries the fullscreenAllowed attribute is calculated based on
// whether all enclosing frames have the "mozFullscreenAllowed" attribute
// set to "true". fullscreenAllowed is set at the process boundaries to
// propagate the value of the parent's "mozFullscreenAllowed" attribute
// across process boundaries.
return NS_ERROR_UNEXPECTED;
}
mFullscreenAllowed = (aFullscreenAllowed ? PARENT_ALLOWS : PARENT_PROHIBITS);
return NS_OK;
}
hal::ScreenOrientation nsDocShell::OrientationLock() {
return mOrientationLock;
}
@@ -2622,8 +2638,21 @@ void nsDocShell::MaybeClearStorageAccessFlag() {
NS_IMETHODIMP
nsDocShell::GetInProcessSameTypeParent(nsIDocShellTreeItem** aParent) {
if (BrowsingContext* parentBC = mBrowsingContext->GetParent()) {
*aParent = do_AddRef(parentBC->GetDocShell()).take();
NS_ENSURE_ARG_POINTER(aParent);
*aParent = nullptr;
if (nsIDocShell::GetIsMozBrowser()) {
return NS_OK;
}
nsCOMPtr<nsIDocShellTreeItem> parent =
do_QueryInterface(GetAsSupports(mParent));
if (!parent) {
return NS_OK;
}
if (parent->ItemType() == mItemType) {
parent.swap(*aParent);
}
return NS_OK;
}
@@ -3867,6 +3896,10 @@ nsresult nsDocShell::LoadErrorPage(nsIURI* aURI, const char16_t* aURL,
}
errorPageUrl.AppendLiteral("&c=UTF-8");
nsAutoCString frameType(FrameTypeToString(mFrameType));
errorPageUrl.AppendLiteral("&f=");
errorPageUrl.AppendASCII(frameType.get());
nsCOMPtr<nsICaptivePortalService> cps = do_GetService(NS_CAPTIVEPORTAL_CID);
int32_t cpsState;
if (cps && NS_SUCCEEDED(cps->GetState(&cpsState)) &&
@@ -4690,7 +4723,9 @@ nsDocShell::SetIsActive(bool aIsActive) {
continue;
}
docshell->SetIsActive(aIsActive);
if (!docshell->GetIsMozBrowser()) {
docshell->SetIsActive(aIsActive);
}
}
// Restart or stop meta refresh timers if necessary
@@ -8979,7 +9014,8 @@ nsresult nsDocShell::InternalLoad(nsDocShellLoadState* aLoadState,
}
}
bool isTopLevelDoc = mBrowsingContext->IsTopContent();
bool isTopLevelDoc =
mItemType == typeContent && (!IsFrame() || GetIsMozBrowser());
OriginAttributes attrs = GetOriginAttributes();
attrs.SetFirstPartyDomain(isTopLevelDoc, aLoadState->URI());
@@ -12359,6 +12395,46 @@ nsDocShell::GetCanExecuteScripts(bool* aResult) {
return NS_OK;
}
/* [infallible] */
NS_IMETHODIMP nsDocShell::SetFrameType(FrameType aFrameType) {
mFrameType = aFrameType;
return NS_OK;
}
/* [infallible] */
NS_IMETHODIMP nsDocShell::GetFrameType(FrameType* aFrameType) {
*aFrameType = mFrameType;
return NS_OK;
}
/* [infallible] */
NS_IMETHODIMP nsDocShell::GetIsMozBrowser(bool* aIsMozBrowser) {
*aIsMozBrowser = (mFrameType == FRAME_TYPE_BROWSER);
return NS_OK;
}
uint32_t nsDocShell::GetInheritedFrameType() {
if (mFrameType != FRAME_TYPE_REGULAR) {
return mFrameType;
}
nsCOMPtr<nsIDocShellTreeItem> parentAsItem;
GetInProcessSameTypeParent(getter_AddRefs(parentAsItem));
nsCOMPtr<nsIDocShell> parent = do_QueryInterface(parentAsItem);
if (!parent) {
return FRAME_TYPE_REGULAR;
}
return static_cast<nsDocShell*>(parent.get())->GetInheritedFrameType();
}
/* [infallible] */
NS_IMETHODIMP nsDocShell::GetIsInMozBrowser(bool* aIsInMozBrowser) {
*aIsInMozBrowser = (GetInheritedFrameType() == FRAME_TYPE_BROWSER);
return NS_OK;
}
/* [infallible] */
NS_IMETHODIMP nsDocShell::GetIsTopLevelContentDocShell(
bool* aIsTopLevelContentDocShell) {