зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1255266 - create sandbox with system principal. r=jryans,khuey.
MozReview-Commit-ID: LZRA24MRp1K --HG-- extra : rebase_source : 3cb57e131321848da764e26b3741443f91acb003
This commit is contained in:
Родитель
f00a582ac4
Коммит
b9e0dc0161
|
@ -62,18 +62,28 @@ XPCOMUtils.defineLazyGetter(loaderModules, "xpcInspector", () => {
|
|||
XPCOMUtils.defineLazyGetter(loaderModules, "indexedDB", () => {
|
||||
// On xpcshell, we can't instantiate indexedDB without crashing
|
||||
try {
|
||||
return Cu.Sandbox(this, {wantGlobalProperties:["indexedDB"]}).indexedDB;
|
||||
let sandbox
|
||||
= Cu.Sandbox(CC('@mozilla.org/systemprincipal;1', 'nsIPrincipal')(),
|
||||
{wantGlobalProperties: ["indexedDB"]});
|
||||
return sandbox.indexedDB;
|
||||
|
||||
} catch(e) {
|
||||
return {};
|
||||
}
|
||||
});
|
||||
|
||||
XPCOMUtils.defineLazyGetter(loaderModules, "CSS", () => {
|
||||
return Cu.Sandbox(this, {wantGlobalProperties: ["CSS"]}).CSS;
|
||||
let sandbox
|
||||
= Cu.Sandbox(CC('@mozilla.org/systemprincipal;1', 'nsIPrincipal')(),
|
||||
{wantGlobalProperties: ["CSS"]});
|
||||
return sandbox.CSS;
|
||||
});
|
||||
|
||||
XPCOMUtils.defineLazyGetter(loaderModules, "URL", () => {
|
||||
return Cu.Sandbox(this, {wantGlobalProperties: ["URL"]}).URL;
|
||||
let sandbox
|
||||
= Cu.Sandbox(CC('@mozilla.org/systemprincipal;1', 'nsIPrincipal')(),
|
||||
{wantGlobalProperties: ["URL"]});
|
||||
return sandbox.URL;
|
||||
});
|
||||
|
||||
var sharedGlobalBlocklist = ["sdk/indexed-db"];
|
||||
|
|
Загрузка…
Ссылка в новой задаче