From 05785798fba54214b481bb5625ac35b2cde0e5a5 Mon Sep 17 00:00:00 2001 From: Alexandre Poirot Date: Wed, 14 Dec 2016 08:33:54 -0800 Subject: [PATCH] Bug 1323466 - Lazy load optional deps from toolbox.js. r=jryans MozReview-Commit-ID: 1E8fm9dfCwj --HG-- extra : rebase_source : 450455e6d9044c264cbf4513622a87b9ce99c267 --- devtools/client/framework/toolbox.js | 11 ++++++----- .../shared/widgets/tooltip/EventTooltipHelper.js | 3 ++- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/devtools/client/framework/toolbox.js b/devtools/client/framework/toolbox.js index c7c14df2967d..35fdafd9e821 100644 --- a/devtools/client/framework/toolbox.js +++ b/devtools/client/framework/toolbox.js @@ -13,7 +13,6 @@ const OS_IS_64_BITS = "DEVTOOLS_OS_IS_64_BITS_PER_USER"; const HOST_HISTOGRAM = "DEVTOOLS_TOOLBOX_HOST"; const SCREENSIZE_HISTOGRAM = "DEVTOOLS_SCREEN_RESOLUTION_ENUMERATED_PER_USER"; const HTML_NS = "http://www.w3.org/1999/xhtml"; -const { SourceMapService } = require("./source-map-service"); var {Ci, Cu} = require("chrome"); var promise = require("promise"); @@ -23,8 +22,6 @@ var {Task} = require("devtools/shared/task"); var {gDevTools} = require("devtools/client/framework/devtools"); var EventEmitter = require("devtools/shared/event-emitter"); var Telemetry = require("devtools/client/shared/telemetry"); -var HUDService = require("devtools/client/webconsole/hudservice"); -var viewSource = require("devtools/client/shared/view-source"); var { attachThread, detachThread } = require("./attach-thread"); var Menu = require("devtools/client/framework/menu"); var MenuItem = require("devtools/client/framework/menu-item"); @@ -63,8 +60,12 @@ loader.lazyRequireGetter(this, "settleAll", "devtools/shared/ThreadSafeDevToolsUtils", true); loader.lazyRequireGetter(this, "ToolboxButtons", "devtools/client/definitions", true); -loader.lazyRequireGetter(this, "ViewHelpers", - "devtools/client/shared/widgets/view-helpers", true); +loader.lazyRequireGetter(this, "SourceMapService", + "devtools/client/framework/source-map-service", true); +loader.lazyRequireGetter(this, "HUDService", + "devtools/client/webconsole/hudservice"); +loader.lazyRequireGetter(this, "viewSource", + "devtools/client/shared/view-source"); loader.lazyGetter(this, "registerHarOverlay", () => { return require("devtools/client/netmonitor/har/toolbox-overlay").register; diff --git a/devtools/client/shared/widgets/tooltip/EventTooltipHelper.js b/devtools/client/shared/widgets/tooltip/EventTooltipHelper.js index 944443543fa6..e9862c98bd9d 100644 --- a/devtools/client/shared/widgets/tooltip/EventTooltipHelper.js +++ b/devtools/client/shared/widgets/tooltip/EventTooltipHelper.js @@ -9,10 +9,11 @@ const {LocalizationHelper} = require("devtools/shared/l10n"); const L10N = new LocalizationHelper("devtools/client/locales/inspector.properties"); -const viewSource = require("devtools/client/shared/view-source"); const Editor = require("devtools/client/sourceeditor/editor"); const beautify = require("devtools/shared/jsbeautify/beautify"); +loader.lazyRequireGetter(this, "viewSource", "devtools/client/shared/view-source"); + const XHTML_NS = "http://www.w3.org/1999/xhtml"; const CONTAINER_WIDTH = 500;