mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-25 22:01:30 +00:00
Bug 1235657 - Session storage needs to handle origin attributes correctly - part 2 - SessionStorageInternal::restore, r=huseby
This commit is contained in:
parent
a365470b87
commit
0641add434
@ -104,7 +104,18 @@ var SessionStorageInternal = {
|
|||||||
restore: function (aDocShell, aStorageData) {
|
restore: function (aDocShell, aStorageData) {
|
||||||
for (let origin of Object.keys(aStorageData)) {
|
for (let origin of Object.keys(aStorageData)) {
|
||||||
let data = aStorageData[origin];
|
let data = aStorageData[origin];
|
||||||
let principal = Services.scriptSecurityManager.createCodebasePrincipalFromOrigin(origin);
|
|
||||||
|
let principal;
|
||||||
|
|
||||||
|
try {
|
||||||
|
let attrs = ChromeUtils.createOriginAttributesWithUserContextId(origin, aDocShell.userContextId);
|
||||||
|
let originURI = Services.io.newURI(origin, null, null);
|
||||||
|
principal = Services.scriptSecurityManager.createCodebasePrincipal(originURI, attrs);
|
||||||
|
} catch (e) {
|
||||||
|
console.error(e);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
let storageManager = aDocShell.QueryInterface(Ci.nsIDOMStorageManager);
|
let storageManager = aDocShell.QueryInterface(Ci.nsIDOMStorageManager);
|
||||||
let window = aDocShell.QueryInterface(Ci.nsIInterfaceRequestor).getInterface(Ci.nsIDOMWindow);
|
let window = aDocShell.QueryInterface(Ci.nsIInterfaceRequestor).getInterface(Ci.nsIDOMWindow);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user