Bug 1378821 - Stop using sdk/window/utils in DevTools; r=zer0

MozReview-Commit-ID: BD3EGMWtDv1

--HG--
extra : rebase_source : 08a8a66b6926c24e834e79f81b9fe44c4b0be863
This commit is contained in:
Jan Odvarko 2017-07-10 10:55:40 +02:00
parent ded3464199
commit 14bb8750cb
3 changed files with 4 additions and 7 deletions

View File

@ -8,7 +8,6 @@ const Services = require("Services");
const { DOMHelpers } = require("resource://devtools/client/shared/DOMHelpers.jsm");
const { Task } = require("devtools/shared/task");
const defer = require("devtools/shared/defer");
const { getMostRecentBrowserWindow } = require("sdk/window/utils");
const XULNS = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";
const DEV_EDITION_PROMO_URL = "chrome://devtools/content/framework/dev-edition-promo/dev-edition-promo.xul";
@ -150,7 +149,7 @@ function onFrameLoad(frame) {
}
function getGBrowser() {
return getMostRecentBrowserWindow().gBrowser;
return Services.wm.getMostRecentWindow("navigator:browser").gBrowser;
}
function wait(n) {

View File

@ -6,7 +6,6 @@
const events = require("sdk/event/core");
loader.lazyRequireGetter(this, "getOuterId", "sdk/window/utils", true);
loader.lazyRequireGetter(this, "CommandState",
"devtools/shared/gcli/command-state", true);

View File

@ -139,10 +139,9 @@
console.warn("`workerify` should only be used in tests or measuring performance. " +
"This creates an object URL on the browser window, and should not be " +
"used in production.");
// Fetch via window/utils here as we don't want to include
// this module normally.
let { getMostRecentBrowserWindow } = require("sdk/window/utils");
let { URL, Blob } = getMostRecentBrowserWindow();
// Fetch modules here as we don't want to include it normally.
const Services = require("Services");
let { URL, Blob } = Services.wm.getMostRecentWindow("navigator:browser");
let stringifiedFn = createWorkerString(fn);
let blob = new Blob([stringifiedFn]);
let url = URL.createObjectURL(blob);