Bug 1255266 - create sandbox with system principal. r=jryans,khuey.

MozReview-Commit-ID: LZRA24MRp1K

--HG--
extra : rebase_source : 3cb57e131321848da764e26b3741443f91acb003
This commit is contained in:
Shih-Chiang Chien 2016-03-15 19:51:02 +08:00
Родитель f00a582ac4
Коммит b9e0dc0161
1 изменённых файлов: 13 добавлений и 3 удалений

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

@ -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"];