Skip to content

Commit

Permalink
Backed out changeset 6036b8acdab5 (bug 1284395) for asserting in Chro…
Browse files Browse the repository at this point in the history
…meUtils::IsOriginAttributesEqualIgnoringAddonId at nsDocShell.cpp:8007 for Windows debug builds. r=backout
  • Loading branch information
Archaeopteryx committed Sep 19, 2016
1 parent 93618b1 commit b7937d1
Show file tree
Hide file tree
Showing 11 changed files with 15 additions and 104 deletions.
26 changes: 8 additions & 18 deletions browser/base/content/browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -1128,7 +1128,6 @@ var gBrowserInit = {
// [4]: allowThirdPartyFixup (bool)
// [5]: referrerPolicy (int)
// [6]: userContextId (int)
// [7]: originPrincipal (nsIPrincipal)
else if (window.arguments.length >= 3) {
let referrerURI = window.arguments[2];
if (typeof(referrerURI) == "string") {
Expand All @@ -1143,10 +1142,7 @@ var gBrowserInit = {
let userContextId = (window.arguments[6] != undefined ?
window.arguments[6] : Ci.nsIScriptSecurityManager.DEFAULT_USER_CONTEXT_ID);
loadURI(uriToLoad, referrerURI, window.arguments[3] || null,
window.arguments[4] || false, referrerPolicy, userContextId,
// pass the origin principal (if any) and force its use to create
// an initial about:blank viewer if present:
window.arguments[7], !!window.arguments[7]);
window.arguments[4] || false, referrerPolicy, userContextId);
window.focus();
}
// Note: loadOneOrMoreURIs *must not* be called if window.arguments.length >= 3.
Expand Down Expand Up @@ -2037,17 +2033,14 @@ function BrowserTryToCloseWindow()
}

function loadURI(uri, referrer, postData, allowThirdPartyFixup, referrerPolicy,
userContextId, originPrincipal, forceAboutBlankViewerInCurrent) {
userContextId) {
try {
openLinkIn(uri, "current",
{ referrerURI: referrer,
referrerPolicy: referrerPolicy,
postData: postData,
allowThirdPartyFixup: allowThirdPartyFixup,
userContextId: userContextId,
originPrincipal,
forceAboutBlankViewerInCurrent,
});
userContextId: userContextId });
} catch (e) {}
}

Expand Down Expand Up @@ -5577,14 +5570,11 @@ function handleLinkClick(event, href, linkNode) {
}

urlSecurityCheck(href, doc.nodePrincipal);
let params = {
charset: doc.characterSet,
allowMixedContent: persistAllowMixedContentInChildTab,
referrerURI: referrerURI,
referrerPolicy: referrerPolicy,
noReferrer: BrowserUtils.linkHasNoReferrer(linkNode),
originPrincipal: doc.nodePrincipal,
};
let params = { charset: doc.characterSet,
allowMixedContent: persistAllowMixedContentInChildTab,
referrerURI: referrerURI,
referrerPolicy: referrerPolicy,
noReferrer: BrowserUtils.linkHasNoReferrer(linkNode) };

// The new tab/window must use the same userContextId
if (doc.nodePrincipal.originAttributes.userContextId) {
Expand Down
1 change: 0 additions & 1 deletion browser/base/content/content.js
Original file line number Diff line number Diff line change
Expand Up @@ -503,7 +503,6 @@ var ClickEventHandler = {
json.allowMixedContent = true;
} catch (e) {}
}
json.originPrincipal = ownerDoc.nodePrincipal;

sendAsyncMessage("Content:Click", json);
return;
Expand Down
1 change: 0 additions & 1 deletion browser/base/content/nsContextMenu.js
Original file line number Diff line number Diff line change
Expand Up @@ -965,7 +965,6 @@ nsContextMenu.prototype = {

_openLinkInParameters : function (extra) {
let params = { charset: gContextMenuContentData.charSet,
originPrincipal: this.principal,
referrerURI: gContextMenuContentData.documentURIObject,
referrerPolicy: gContextMenuContentData.referrerPolicy,
noReferrer: this.linkHasNoReferrer };
Expand Down
9 changes: 0 additions & 9 deletions browser/base/content/tabbrowser.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1500,7 +1500,6 @@
var aNoReferrer;
var aUserContextId;
var aRelatedBrowser;
var aOriginPrincipal;
if (arguments.length == 2 &&
typeof arguments[1] == "object" &&
!(arguments[1] instanceof Ci.nsIURI)) {
Expand All @@ -1519,7 +1518,6 @@
aNoReferrer = params.noReferrer;
aUserContextId = params.userContextId;
aRelatedBrowser = params.relatedBrowser;
aOriginPrincipal = params.originPrincipal;
}
var bgLoad = (aLoadInBackground != null) ? aLoadInBackground :
Expand All @@ -1539,7 +1537,6 @@
forceNotRemote: aForceNotRemote,
noReferrer: aNoReferrer,
userContextId: aUserContextId,
originPrincipal: aOriginPrincipal,
relatedBrowser: aRelatedBrowser });
if (!bgLoad)
this.selectedTab = tab;
Expand Down Expand Up @@ -1997,7 +1994,6 @@
var aUserContextId;
var aEventDetail;
var aRelatedBrowser;
var aOriginPrincipal;
if (arguments.length == 2 &&
typeof arguments[1] == "object" &&
!(arguments[1] instanceof Ci.nsIURI)) {
Expand All @@ -2017,7 +2013,6 @@
aUserContextId = params.userContextId;
aEventDetail = params.eventDetail;
aRelatedBrowser = params.relatedBrowser;
aOriginPrincipal = params.originPrincipal;
}
// if we're adding tabs, we're past interrupt mode, ditch the owner
Expand Down Expand Up @@ -2097,10 +2092,6 @@
var evt = new CustomEvent("TabOpen", { bubbles: true, detail });
t.dispatchEvent(evt);
if (!usingPreloadedContent && aOriginPrincipal) {
b.createAboutBlankContentViewer(aOriginPrincipal);
}
// If we didn't swap docShells with a preloaded browser
// then let's just continue loading the page normally.
if (!usingPreloadedContent && !uriIsAboutBlank) {
Expand Down
1 change: 0 additions & 1 deletion browser/base/content/test/general/browser.ini
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,6 @@ subsuite = clipboard
[browser_mixed_content_cert_override.js]
[browser_mixedcontent_securityflags.js]
tags = mcb
[browser_modifiedclick_inherit_principal.js]
[browser_offlineQuotaNotification.js]
skip-if = buildapp == 'mulet'
[browser_feed_discovery.js]
Expand Down

This file was deleted.

11 changes: 1 addition & 10 deletions browser/base/content/utilityOverlay.js
Original file line number Diff line number Diff line change
Expand Up @@ -222,9 +222,6 @@ function openLinkIn(url, where, params) {
var aAllowPopups = !!params.allowPopups;
var aUserContextId = params.userContextId;
var aIndicateErrorPageLoad = params.indicateErrorPageLoad;
var aPrincipal = params.originPrincipal;
var aForceAboutBlankViewerInCurrent =
params.forceAboutBlankViewerInCurrent;

if (where == "save") {
// TODO(1073187): propagate referrerPolicy.
Expand Down Expand Up @@ -293,7 +290,6 @@ function openLinkIn(url, where, params) {
sa.AppendElement(allowThirdPartyFixupSupports);
sa.AppendElement(referrerPolicySupports);
sa.AppendElement(userContextIdSupports);
sa.AppendElement(aPrincipal);

let features = "chrome,dialog=no,all";
if (aIsPrivate) {
Expand Down Expand Up @@ -361,10 +357,6 @@ function openLinkIn(url, where, params) {
flags |= Ci.nsIWebNavigation.LOAD_FLAGS_ERROR_LOAD_CHANGES_RV;
}

if (aForceAboutBlankViewerInCurrent) {
w.gBrowser.selectedBrowser.createAboutBlankContentViewer(aPrincipal);
}

w.gBrowser.loadURIWithFlags(url, {
flags: flags,
referrerURI: aNoReferrer ? null : aReferrerURI,
Expand All @@ -388,8 +380,7 @@ function openLinkIn(url, where, params) {
skipAnimation: aSkipTabAnimation,
allowMixedContent: aAllowMixedContent,
noReferrer: aNoReferrer,
userContextId: aUserContextId,
originPrincipal: aPrincipal,
userContextId: aUserContextId
});
break;
}
Expand Down
15 changes: 6 additions & 9 deletions browser/modules/ContentClick.jsm
Original file line number Diff line number Diff line change
Expand Up @@ -77,15 +77,12 @@ var ContentClick = {

// Todo(903022): code for where == save

let params = {
charset: browser.characterSet,
referrerURI: browser.documentURI,
referrerPolicy: json.referrerPolicy,
noReferrer: json.noReferrer,
allowMixedContent: json.allowMixedContent,
isContentWindowPrivate: json.isContentWindowPrivate,
originPrincipal: json.originPrincipal,
};
let params = { charset: browser.characterSet,
referrerURI: browser.documentURI,
referrerPolicy: json.referrerPolicy,
noReferrer: json.noReferrer,
allowMixedContent: json.allowMixedContent,
isContentWindowPrivate: json.isContentWindowPrivate};

// The new tab/window must use the same userContextId.
if (json.originAttributes.userContextId) {
Expand Down
7 changes: 0 additions & 7 deletions toolkit/content/browser-child.js
Original file line number Diff line number Diff line change
Expand Up @@ -565,13 +565,6 @@ addMessageListener("Browser:Thumbnail:GetOriginalURL", function (aMessage) {
});
});

/**
* Remote createAboutBlankContentViewer request handler.
*/
addMessageListener("Browser:CreateAboutBlank", function(aMessage) {
docShell.createAboutBlankContentViewer(aMessage.data);
});

// The AddonsChild needs to be rooted so that it stays alive as long as
// the tab.
var AddonsChild = RemoteAddonsChild.init(this);
Expand Down
9 changes: 0 additions & 9 deletions toolkit/content/widgets/browser.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1038,15 +1038,6 @@
</body>
</method>

<method name="createAboutBlankContentViewer">
<parameter name="aPrincipal"/>
<body>
<![CDATA[
this.docShell.createAboutBlankContentViewer(aPrincipal);
]]>
</body>
</method>

<field name="_AUTOSCROLL_SNAP">10</field>
<field name="_scrolling">false</field>
<field name="_startX">null</field>
Expand Down
9 changes: 0 additions & 9 deletions toolkit/content/widgets/remote-browser.xml
Original file line number Diff line number Diff line change
Expand Up @@ -561,15 +561,6 @@
]]>
</body>
</method>

<method name="createAboutBlankContentViewer">
<parameter name="aPrincipal"/>
<body>
<![CDATA[
this.messageManager.sendAsyncMessage("Browser:CreateAboutBlank", aPrincipal);
]]>
</body>
</method>
</implementation>
<handlers>
<handler event="dragstart">
Expand Down

0 comments on commit b7937d1

Please sign in to comment.