зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1223452 - avoid Cu.importGlobalProperties; r=ochameau
This commit is contained in:
Родитель
b9490dccae
Коммит
cd8408f583
|
@ -13,6 +13,8 @@ var EventEmitter = require("devtools/shared/event-emitter");
|
|||
var clipboard = require("sdk/clipboard");
|
||||
var {HostType} = require("devtools/client/framework/toolbox").Toolbox;
|
||||
|
||||
loader.lazyRequireGetter(this, "CSS", "CSS");
|
||||
|
||||
loader.lazyGetter(this, "MarkupView", () => require("devtools/client/markupview/markup-view").MarkupView);
|
||||
loader.lazyGetter(this, "HTMLBreadcrumbs", () => require("devtools/client/inspector/breadcrumbs").HTMLBreadcrumbs);
|
||||
loader.lazyGetter(this, "ToolSidebar", () => require("devtools/client/framework/sidebar").ToolSidebar);
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
"use strict";
|
||||
|
||||
const {Cc, Ci, Cu} = require("chrome");
|
||||
Cu.importGlobalProperties(["CSS"]);
|
||||
loader.lazyRequireGetter(this, "CSS", "CSS");
|
||||
const promise = require("promise");
|
||||
Cu.import("resource://gre/modules/Task.jsm", this);
|
||||
loader.lazyGetter(this, "DOMUtils", () => {
|
||||
|
|
|
@ -78,6 +78,8 @@ const {
|
|||
const {getLayoutChangesObserver, releaseLayoutChangesObserver} =
|
||||
require("devtools/server/actors/layout");
|
||||
|
||||
loader.lazyRequireGetter(this, "CSS", "CSS");
|
||||
|
||||
const {EventParsers} = require("devtools/shared/event-parsers");
|
||||
|
||||
const FONT_FAMILY_PREVIEW_TEXT = "The quick brown fox jumps over the lazy dog";
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
/* globals CSS */
|
||||
|
||||
"use strict";
|
||||
|
||||
|
@ -18,6 +17,8 @@ const {PSEUDO_ELEMENT_SET} = require("devtools/shared/styleinspector/css-logic")
|
|||
const {UPDATE_PRESERVING_RULES, UPDATE_GENERAL} =
|
||||
require("devtools/server/actors/stylesheets");
|
||||
|
||||
loader.lazyRequireGetter(this, "CSS", "CSS");
|
||||
|
||||
loader.lazyGetter(this, "CssLogic", () => {
|
||||
return require("devtools/shared/styleinspector/css-logic").CssLogic;
|
||||
});
|
||||
|
|
|
@ -67,6 +67,10 @@ XPCOMUtils.defineLazyGetter(loaderModules, "indexedDB", () => {
|
|||
}
|
||||
});
|
||||
|
||||
XPCOMUtils.defineLazyGetter(loaderModules, "CSS", () => {
|
||||
return Cu.Sandbox(this, {wantGlobalProperties: ["CSS"]}).CSS;
|
||||
});
|
||||
|
||||
var sharedGlobalBlacklist = ["sdk/indexed-db"];
|
||||
|
||||
/**
|
||||
|
@ -378,6 +382,7 @@ DevToolsLoader.prototype = {
|
|||
this._provider.globals = {
|
||||
isWorker: false,
|
||||
reportError: Cu.reportError,
|
||||
atob: atob,
|
||||
btoa: btoa,
|
||||
_Iterator: Iterator,
|
||||
loader: {
|
||||
|
|
|
@ -75,9 +75,7 @@ exports.PSEUDO_ELEMENT_SET = PSEUDO_ELEMENT_SET;
|
|||
|
||||
// This should be ok because none of the functions that use this should be used
|
||||
// on the worker thread, where Cu is not available.
|
||||
if (Cu) {
|
||||
Cu.importGlobalProperties(["CSS"]);
|
||||
}
|
||||
loader.lazyRequireGetter(this, "CSS", "CSS");
|
||||
|
||||
function CssLogic()
|
||||
{
|
||||
|
|
|
@ -13,8 +13,6 @@ const Services = require("Services");
|
|||
const {DebuggerServer} = require("devtools/server/main");
|
||||
const DevToolsUtils = require("devtools/shared/DevToolsUtils");
|
||||
|
||||
Cu.importGlobalProperties(["atob"]);
|
||||
|
||||
loader.lazyGetter(this, "NetworkHelper", () => require("devtools/shared/webconsole/network-helper"));
|
||||
|
||||
// Helper tracer. Should be generic sharable by other modules (bug 1171927)
|
||||
|
|
Загрузка…
Ссылка в новой задаче