Bug 1520862 - Fixing WebNavigation serialization of principals to always be present. r=ckerschb

Differential Revision: https://phabricator.services.mozilla.com/D16884

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Jonathan Kingston 2019-01-17 18:50:40 +00:00
Родитель c87a6c66d7
Коммит c3cdc8746c
4 изменённых файлов: 8 добавлений и 8 удалений

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

@ -79,9 +79,9 @@ BrowserElementWebNavigation.prototype = {
postData: postData ? readInputStreamToString(postData) : null,
headers: headers ? readInputStreamToString(headers) : null,
baseURI: baseURI ? baseURI.spec : null,
triggeringPrincipal: triggeringPrincipal
? Utils.serializePrincipal(triggeringPrincipal)
: Services.scriptSecurityManager.createNullPrincipal({}),
triggeringPrincipal: Utils.serializePrincipal(
triggeringPrincipal ||
Services.scriptSecurityManager.createNullPrincipal({})),
requestTime: telemetry.msSystemNow(),
});
},

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

@ -108,7 +108,9 @@ class WebNavigationChild extends ActorChild {
if (triggeringPrincipal)
triggeringPrincipal = Utils.deserializePrincipal(triggeringPrincipal);
if (!triggeringPrincipal) {
triggeringPrincipal = Services.scriptSecurityManager.getSystemPrincipal({});
// If we don't have a triggering principal we won't be able to continue the load.
let debug = Cc["@mozilla.org/xpcom/debug;1"].getService(Ci.nsIDebug2);
debug.abort("WebNavigationChild.js", 112);
}
let loadURIOptions = {
triggeringPrincipal,

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

@ -100,7 +100,7 @@ RemoteWebNavigation.prototype = {
headers: aLoadURIOptions.headers ? Utils.serializeInputStream(aLoadURIOptions.headers) : null,
baseURI: aLoadURIOptions.baseURI ? aLoadURIOptions.baseURI.spec : null,
triggeringPrincipal: Utils.serializePrincipal(
aLoadURIOptions.triggeringPrincipal || Services.scriptSecurityManager.createNullPrincipal({})),
aLoadURIOptions.triggeringPrincipal || Services.scriptSecurityManager.createNullPrincipal({})),
requestTime: Services.telemetry.msSystemNow(),
});
},

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

@ -332,9 +332,7 @@ var E10SUtils = {
uri: aURI.spec,
flags: aFlags || Ci.nsIWebNavigation.LOAD_FLAGS_NONE,
referrer: aReferrer ? aReferrer.spec : null,
triggeringPrincipal: aTriggeringPrincipal
? Utils.serializePrincipal(aTriggeringPrincipal)
: null,
triggeringPrincipal: Utils.serializePrincipal(aTriggeringPrincipal || Services.scriptSecurityManager.createNullPrincipal({})),
reloadInFreshProcess: !!aFreshProcess,
},
historyIndex: sessionHistory.legacySHistory.requestedIndex,