Bug 1292184 - remove lazy requires from inspector; r=jlongster

MozReview-Commit-ID: AQMlkXAlVeX

--HG--
extra : rebase_source : 819f3e4f5d70f71514700ba21de8a25aace5b5f0
This commit is contained in:
Tom Tromey 2016-08-02 09:14:29 -06:00
Родитель f93a802855
Коммит 586ae2d8aa
8 изменённых файлов: 38 добавлений и 50 удалений

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

@ -22,10 +22,8 @@ const MAX_LABEL_LENGTH = 40;
const NS_XHTML = "http://www.w3.org/1999/xhtml"; const NS_XHTML = "http://www.w3.org/1999/xhtml";
const SCROLL_REPEAT_MS = 100; const SCROLL_REPEAT_MS = 100;
loader.lazyRequireGetter(this, "EventEmitter", const EventEmitter = require("devtools/shared/event-emitter");
"devtools/shared/event-emitter"); const {KeyShortcuts} = require("devtools/client/shared/key-shortcuts");
loader.lazyRequireGetter(this, "KeyShortcuts",
"devtools/client/shared/key-shortcuts", true);
/** /**
* Component to replicate functionality of XUL arrowscrollbox * Component to replicate functionality of XUL arrowscrollbox

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

@ -27,14 +27,10 @@ const {XPCOMUtils} = require("resource://gre/modules/XPCOMUtils.jsm");
/* eslint-enable mozilla/reject-some-requires */ /* eslint-enable mozilla/reject-some-requires */
const {getCssProperties} = require("devtools/shared/fronts/css-properties"); const {getCssProperties} = require("devtools/shared/fronts/css-properties");
loader.lazyRequireGetter(this, "overlays", const overlays = require("devtools/client/inspector/shared/style-inspector-overlays");
"devtools/client/inspector/shared/style-inspector-overlays"); const StyleInspectorMenu = require("devtools/client/inspector/shared/style-inspector-menu");
loader.lazyRequireGetter(this, "StyleInspectorMenu", const {KeyShortcuts} = require("devtools/client/shared/key-shortcuts");
"devtools/client/inspector/shared/style-inspector-menu"); const {LayoutView} = require("devtools/client/inspector/layout/layout");
loader.lazyRequireGetter(this, "KeyShortcuts",
"devtools/client/shared/key-shortcuts", true);
loader.lazyRequireGetter(this, "LayoutView",
"devtools/client/inspector/layout/layout", true);
XPCOMUtils.defineLazyModuleGetter(this, "PluralForm", XPCOMUtils.defineLazyModuleGetter(this, "PluralForm",
"resource://gre/modules/PluralForm.jsm"); "resource://gre/modules/PluralForm.jsm");

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

@ -5,7 +5,7 @@
"use strict"; "use strict";
const l10n = require("gcli/l10n"); const l10n = require("gcli/l10n");
loader.lazyRequireGetter(this, "gDevTools", "devtools/client/framework/devtools", true); const {gDevTools} = require("devtools/client/framework/devtools");
/* eslint-disable mozilla/reject-some-requires */ /* eslint-disable mozilla/reject-some-requires */
const {EyeDropper, HighlighterEnvironment} = require("devtools/server/actors/highlighters"); const {EyeDropper, HighlighterEnvironment} = require("devtools/server/actors/highlighters");
/* eslint-enable mozilla/reject-some-requires */ /* eslint-enable mozilla/reject-some-requires */

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

@ -3,8 +3,6 @@
/* This Source Code Form is subject to the terms of the Mozilla Public /* 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 * 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/. */ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
/* Experimenting with 100 char long lines */
/* eslint max-len: [2, 100, 2, {ignoreUrls: true, "ignorePattern": "\\s*require\\s*\\(|^\\s*loader\\.lazy|-\\*-"}] */ // eslint-disable-line
"use strict"; "use strict";
@ -27,17 +25,17 @@ const Telemetry = require("devtools/client/shared/telemetry");
const Menu = require("devtools/client/framework/menu"); const Menu = require("devtools/client/framework/menu");
const MenuItem = require("devtools/client/framework/menu-item"); const MenuItem = require("devtools/client/framework/menu-item");
loader.lazyRequireGetter(this, "CSS", "CSS"); const CSS = require("CSS");
loader.lazyRequireGetter(this, "CommandUtils", "devtools/client/shared/developer-toolbar", true); const {CommandUtils} = require("devtools/client/shared/developer-toolbar");
loader.lazyRequireGetter(this, "ComputedViewTool", "devtools/client/inspector/computed/computed", true); const {ComputedViewTool} = require("devtools/client/inspector/computed/computed");
loader.lazyRequireGetter(this, "FontInspector", "devtools/client/inspector/fonts/fonts", true); const {FontInspector} = require("devtools/client/inspector/fonts/fonts");
loader.lazyRequireGetter(this, "HTMLBreadcrumbs", "devtools/client/inspector/breadcrumbs", true); const {HTMLBreadcrumbs} = require("devtools/client/inspector/breadcrumbs");
loader.lazyRequireGetter(this, "InspectorSearch", "devtools/client/inspector/inspector-search", true); const {InspectorSearch} = require("devtools/client/inspector/inspector-search");
loader.lazyRequireGetter(this, "MarkupView", "devtools/client/inspector/markup/markup", true); const {MarkupView} = require("devtools/client/inspector/markup/markup");
loader.lazyRequireGetter(this, "RuleViewTool", "devtools/client/inspector/rules/rules", true); const {RuleViewTool} = require("devtools/client/inspector/rules/rules");
loader.lazyRequireGetter(this, "ToolSidebar", "devtools/client/inspector/toolsidebar", true); const {ToolSidebar} = require("devtools/client/inspector/toolsidebar");
loader.lazyRequireGetter(this, "ViewHelpers", "devtools/client/shared/widgets/view-helpers", true); const {ViewHelpers} = require("devtools/client/shared/widgets/view-helpers");
loader.lazyGetter(this, "strings", () => { loader.lazyGetter(this, "strings", () => {
return Services.strings.createBundle("chrome://devtools/locale/inspector.properties"); return Services.strings.createBundle("chrome://devtools/locale/inspector.properties");
@ -216,7 +214,8 @@ InspectorPanel.prototype = {
// is selected. // is selected.
this.updateDebuggerPausedWarning = () => { this.updateDebuggerPausedWarning = () => {
let notificationBox = this._toolbox.getNotificationBox(); let notificationBox = this._toolbox.getNotificationBox();
let notification = notificationBox.getNotificationWithValue("inspector-script-paused"); let notification =
notificationBox.getNotificationWithValue("inspector-script-paused");
if (!notification && this._toolbox.currentToolId == "inspector" && if (!notification && this._toolbox.currentToolId == "inspector" &&
this._toolbox.threadClient.paused) { this._toolbox.threadClient.paused) {
let message = strings.GetStringFromName("debuggerPausedWarning.message"); let message = strings.GetStringFromName("debuggerPausedWarning.message");
@ -1517,9 +1516,12 @@ InspectorPanel.prototype = {
}, },
/** /**
* Copy the content of a longString (via a promise resolving a LongStringActor) to the clipboard * Copy the content of a longString (via a promise resolving a
* @param {Promise} longStringActorPromise promise expected to resolve a LongStringActor instance * LongStringActor) to the clipboard
* @return {Promise} promise resolving (with no argument) when the string is sent to the clipboard * @param {Promise} longStringActorPromise promise expected to
* resolve a LongStringActor instance
* @return {Promise} promise resolving (with no argument) when the
* string is sent to the clipboard
*/ */
_copyLongString: function (longStringActorPromise) { _copyLongString: function (longStringActorPromise) {
return this._getLongString(longStringActorPromise).then(string => { return this._getLongString(longStringActorPromise).then(string => {
@ -1529,7 +1531,8 @@ InspectorPanel.prototype = {
/** /**
* Retrieve the content of a longString (via a promise resolving a LongStringActor) * Retrieve the content of a longString (via a promise resolving a LongStringActor)
* @param {Promise} longStringActorPromise promise expected to resolve a LongStringActor instance * @param {Promise} longStringActorPromise promise expected to
* resolve a LongStringActor instance
* @return {Promise} promise resolving with the retrieved string as argument * @return {Promise} promise resolving with the retrieved string as argument
*/ */
_getLongString: function (longStringActorPromise) { _getLongString: function (longStringActorPromise) {

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

@ -10,9 +10,9 @@ const {Ci} = require("chrome");
const promise = require("promise"); const promise = require("promise");
const {Task} = require("devtools/shared/task"); const {Task} = require("devtools/shared/task");
loader.lazyGetter(this, "system", () => require("devtools/shared/system")); const system = require("devtools/shared/system");
loader.lazyGetter(this, "EventEmitter", () => require("devtools/shared/event-emitter")); const EventEmitter = require("devtools/shared/event-emitter");
loader.lazyGetter(this, "AutocompletePopup", () => require("devtools/client/shared/autocomplete-popup").AutocompletePopup); const {AutocompletePopup} = require("devtools/client/shared/autocomplete-popup");
// Maximum number of selector suggestions shown in the panel. // Maximum number of selector suggestions shown in the panel.
const MAX_SUGGESTIONS = 15; const MAX_SUGGESTIONS = 15;

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

@ -61,10 +61,8 @@ const {XPCOMUtils} = require("resource://gre/modules/XPCOMUtils.jsm");
/* eslint-enable mozilla/reject-some-requires */ /* eslint-enable mozilla/reject-some-requires */
const {getCssProperties} = require("devtools/shared/fronts/css-properties"); const {getCssProperties} = require("devtools/shared/fronts/css-properties");
loader.lazyRequireGetter(this, "CSS", "CSS"); const CSS = require("CSS");
loader.lazyGetter(this, "AutocompletePopup", () => { const {AutocompletePopup} = require("devtools/client/shared/autocomplete-popup");
return require("devtools/client/shared/autocomplete-popup").AutocompletePopup;
});
XPCOMUtils.defineLazyModuleGetter(this, "PluralForm", XPCOMUtils.defineLazyModuleGetter(this, "PluralForm",
"resource://gre/modules/PluralForm.jsm"); "resource://gre/modules/PluralForm.jsm");

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

@ -29,14 +29,10 @@ const {createChild, promiseWarn, throttle} = require("devtools/client/inspector/
const {gDevTools} = require("devtools/client/framework/devtools"); const {gDevTools} = require("devtools/client/framework/devtools");
const {getCssProperties} = require("devtools/shared/fronts/css-properties"); const {getCssProperties} = require("devtools/shared/fronts/css-properties");
loader.lazyRequireGetter(this, "overlays", const overlays = require("devtools/client/inspector/shared/style-inspector-overlays");
"devtools/client/inspector/shared/style-inspector-overlays"); const EventEmitter = require("devtools/shared/event-emitter");
loader.lazyRequireGetter(this, "EventEmitter", const StyleInspectorMenu = require("devtools/client/inspector/shared/style-inspector-menu");
"devtools/shared/event-emitter"); const {KeyShortcuts} = require("devtools/client/shared/key-shortcuts");
loader.lazyRequireGetter(this, "StyleInspectorMenu",
"devtools/client/inspector/shared/style-inspector-menu");
loader.lazyRequireGetter(this, "KeyShortcuts",
"devtools/client/shared/key-shortcuts", true);
XPCOMUtils.defineLazyGetter(this, "clipboardHelper", function () { XPCOMUtils.defineLazyGetter(this, "clipboardHelper", function () {
return Cc["@mozilla.org/widget/clipboardhelper;1"] return Cc["@mozilla.org/widget/clipboardhelper;1"]
@ -48,9 +44,7 @@ XPCOMUtils.defineLazyGetter(this, "_strings", function () {
"chrome://devtools-shared/locale/styleinspector.properties"); "chrome://devtools-shared/locale/styleinspector.properties");
}); });
loader.lazyGetter(this, "AutocompletePopup", function () { const {AutocompletePopup} = require("devtools/client/shared/autocomplete-popup");
return require("devtools/client/shared/autocomplete-popup").AutocompletePopup;
});
const HTML_NS = "http://www.w3.org/1999/xhtml"; const HTML_NS = "http://www.w3.org/1999/xhtml";
const PREF_UA_STYLES = "devtools.inspector.showUserAgentStyles"; const PREF_UA_STYLES = "devtools.inspector.showUserAgentStyles";

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

@ -14,8 +14,7 @@ const {Task} = require("devtools/shared/task");
const Menu = require("devtools/client/framework/menu"); const Menu = require("devtools/client/framework/menu");
const MenuItem = require("devtools/client/framework/menu-item"); const MenuItem = require("devtools/client/framework/menu-item");
loader.lazyRequireGetter(this, "overlays", const overlays = require("devtools/client/inspector/shared/style-inspector-overlays");
"devtools/client/inspector/shared/style-inspector-overlays");
loader.lazyServiceGetter(this, "clipboardHelper", loader.lazyServiceGetter(this, "clipboardHelper",
"@mozilla.org/widget/clipboardhelper;1", "nsIClipboardHelper"); "@mozilla.org/widget/clipboardhelper;1", "nsIClipboardHelper");
loader.lazyGetter(this, "_strings", () => { loader.lazyGetter(this, "_strings", () => {