# HG changeset patch # User Julian Descottes # Date 1521557574 -3600 # Node ID 1565b5c867a45f30d9f8de8dcbdb512cd72f1da5 # Parent d9933f92bf0104a3741813fb0066b26aa96d8776 Bug 1444926 - Remove mentions of DevTools addon or DevTools moving to GitHub;r=ochameau MozReview-Commit-ID: GZwMXU9n0k diff --git a/browser/installer/package-manifest.in b/browser/installer/package-manifest.in --- a/browser/installer/package-manifest.in +++ b/browser/installer/package-manifest.in @@ -614,17 +614,17 @@ #endif @RESPATH@/browser/features/* ; [Webide Files] @RESPATH@/browser/chrome/webide@JAREXT@ @RESPATH@/browser/chrome/webide.manifest @RESPATH@/browser/@PREF_DIR@/webide-prefs.js -; [DevTools Shim Files] +; [DevTools Startup Files] @RESPATH@/browser/chrome/devtools-startup@JAREXT@ @RESPATH@/browser/chrome/devtools-startup.manifest @RESPATH@/browser/@PREF_DIR@/devtools-startup-prefs.js ; DevTools @RESPATH@/browser/chrome/devtools@JAREXT@ @RESPATH@/browser/chrome/devtools.manifest @RESPATH@/browser/@PREF_DIR@/devtools.js diff --git a/devtools/client/framework/devtools.js b/devtools/client/framework/devtools.js --- a/devtools/client/framework/devtools.js +++ b/devtools/client/framework/devtools.js @@ -52,19 +52,18 @@ function DevTools() { this._onThemeChanged = this._onThemeChanged.bind(this); addThemeObserver(this._onThemeChanged); // This is important step in initialization codepath where we are going to // start registering all default tools and themes: create menuitems, keys, emit // related events. this.registerDefaults(); - // Register this new DevTools instance to Firefox. DevToolsShim is part of Firefox, - // integrating with all Firefox codebase and making the glue between code from - // mozilla-central and DevTools add-on on github + // Register this DevTools instance on the DevToolsShim, which is used by non-devtools + // code to interact with DevTools. DevToolsShim.register(this); } DevTools.prototype = { // The windowtype of the main window, used in various tools. This may be set // to something different by other gecko apps. chromeWindowType: "navigator:browser", @@ -651,27 +650,25 @@ DevTools.prototype = { await onNewNode; // Now that the node has been selected, wait until the inspector is // fully updated. await inspector.once("inspector-updated"); }, /** - * Either the SDK Loader has been destroyed by the add-on contribution - * workflow, or firefox is shutting down. + * Either the DevTools Loader has been destroyed or firefox is shutting down. * @param {boolean} shuttingDown * True if firefox is currently shutting down. We may prevent doing * some cleanups to speed it up. Otherwise everything need to be * cleaned up in order to be able to load devtools again. */ destroy({ shuttingDown }) { - // Do not cleanup everything during firefox shutdown, but only when - // devtools are reloaded via the add-on contribution workflow. + // Do not cleanup everything during firefox shutdown. if (!shuttingDown) { for (let [, toolbox] of this._toolboxes) { toolbox.destroy(); } } for (let [key, ] of this.getToolDefinitionMap()) { this.unregisterTool(key, true); @@ -681,17 +678,17 @@ DevTools.prototype = { removeThemeObserver(this._onThemeChanged); // Do not unregister devtools from the DevToolsShim if the destroy is caused by an // application shutdown. For instance SessionStore needs to save the Scratchpad // manager state on shutdown. if (!shuttingDown) { // Notify the DevToolsShim that DevTools are no longer available, particularly if - // the destroy was caused by disabling/removing the DevTools add-on. + // the destroy was caused by disabling/removing DevTools. DevToolsShim.unregister(); } // Cleaning down the toolboxes: i.e. // for (let [target, toolbox] of this._toolboxes) toolbox.destroy(); // Is taken care of by the gDevToolsBrowser.forgetBrowserWindow }, diff --git a/devtools/moz.build b/devtools/moz.build --- a/devtools/moz.build +++ b/devtools/moz.build @@ -1,37 +1,30 @@ # -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*- # vim: set filetype=python: # 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/. -if CONFIG['MOZ_DEVTOOLS'] and CONFIG['MOZ_DEVTOOLS'] not in ('all', 'server', 'addon'): +if CONFIG['MOZ_DEVTOOLS'] and CONFIG['MOZ_DEVTOOLS'] not in ('all', 'server'): error('Unsupported MOZ_DEVTOOLS value: %s' % (CONFIG['MOZ_DEVTOOLS'])) if CONFIG['MOZ_DEVTOOLS'] == 'all': DIRS += [ 'client', ] -# `addon` is a special build mode to strip everything except binary components -# and startup modules that are going to stay in Firefox once DevTools ship as an -# add-on. # `platform` contains all native components DIRS += [ + 'server', + 'shared', 'startup', 'platform', ] -if CONFIG['MOZ_DEVTOOLS'] != 'addon': - DIRS += [ - 'server', - 'shared', - ] - # /browser uses DIST_SUBDIR. We opt-in to this treatment when building # DevTools for the browser to keep the root omni.ja slim for use by external XUL # apps. if CONFIG['MOZ_BUILD_APP'] == 'browser': DIST_SUBDIR = 'browser' export('DIST_SUBDIR') with Files('**'): diff --git a/devtools/startup/DevToolsShim.jsm b/devtools/startup/DevToolsShim.jsm --- a/devtools/startup/DevToolsShim.jsm +++ b/devtools/startup/DevToolsShim.jsm @@ -23,48 +23,30 @@ this.EXPORTED_SYMBOLS = [ function removeItem(array, callback) { let index = array.findIndex(callback); if (index >= 0) { array.splice(index, 1); } } /** - * The DevToolsShim is a part of the DevTools go faster project, which moves the Firefox - * DevTools outside of mozilla-central to an add-on. It aims to bridge the gap for - * existing mozilla-central code that still needs to interact with DevTools (such as - * web-extensions). + * DevToolsShim is a singleton that provides a set of helpers to interact with DevTools, + * that work whether Devtools are enabled or not. * - * DevToolsShim is a singleton that provides a set of helpers to interact with DevTools, - * that work whether the DevTools addon is installed or not. It can be used to start - * listening to events, register tools, themes. As soon as a DevTools addon is installed - * the DevToolsShim will forward all the requests received until then to the real DevTools - * instance. - * - * DevToolsShim.isInstalled() can also be used to know if DevTools are currently - * installed. + * It can be used to start listening to devtools events before DevTools are ready. As soon + * as DevTools are enabled, the DevToolsShim will forward all the requests received until + * then to the real DevTools instance. */ this.DevToolsShim = { _gDevTools: null, listeners: [], tools: [], themes: [], /** - * Check if DevTools are currently installed (but not necessarily initialized). - * - * @return {Boolean} true if DevTools are installed. - */ - isInstalled: function() { - return Services.io.getProtocolHandler("resource") - .QueryInterface(Ci.nsIResProtocolHandler) - .hasSubstitution("devtools"); - }, - - /** * Returns true if DevTools are enabled for the current profile. If devtools are not * enabled, initializing DevTools will open the onboarding page. Some entry points * should no-op in this case. */ isEnabled: function() { let enabled = Services.prefs.getBoolPref(DEVTOOLS_ENABLED_PREF); return enabled && !this.isDisabledByPolicy(); }, @@ -235,17 +217,17 @@ this.DevToolsShim = { * * @param {XULTab} tab * The browser tab on which inspect node was used. * @param {Array} selectors * An array of CSS selectors to find the target node. Several selectors can be * needed if the element is nested in frames and not directly in the root * document. * @return {Promise} a promise that resolves when the node is selected in the inspector - * markup view or that resolves immediately if DevTools are not installed. + * markup view or that resolves immediately if DevTools are not enabled. */ inspectNode: function(tab, selectors) { if (!this.isEnabled()) { if (!this.isDisabledByPolicy()) { DevtoolsStartup.openInstallPage("ContextMenu"); } return Promise.resolve(); } diff --git a/devtools/startup/devtools-startup-prefs.js b/devtools/startup/devtools-startup-prefs.js --- a/devtools/startup/devtools-startup-prefs.js +++ b/devtools/startup/devtools-startup-prefs.js @@ -1,17 +1,14 @@ /* 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/. */ -// This Devtools preferences file will be loaded as a usual Firefox preferences file. -// Most DevTools prefs are included with the addon and loaded dynamically during the addon -// startup. For preferences that are required before the addon is loaded or that we can't -// process in JS, they can be defined in this file. -// Note that this preference file follows Firefox release cycle. +// The preferences defined here should be used by the components in devtools-startup. +// devtools-startup is always shipped and those preferences will always be available. // Enable the JSON View tool (an inspector for application/json documents). pref("devtools.jsonview.enabled", true); // Default theme ("dark" or "light") #ifdef MOZ_DEV_EDITION pref("devtools.theme", "dark", sticky); #else diff --git a/devtools/startup/moz.build b/devtools/startup/moz.build --- a/devtools/startup/moz.build +++ b/devtools/startup/moz.build @@ -5,18 +5,18 @@ # file, You can obtain one at http://mozilla.org/MPL/2.0/. JAR_MANIFESTS += ['jar.mn'] JS_PREFERENCE_PP_FILES += [ 'devtools-startup-prefs.js', ] -# Register the about:debugging page only for 'addon' and 'all' builds. -if CONFIG['MOZ_DEVTOOLS'] != 'server': +# Register the startup components only for 'all' builds. +if CONFIG['MOZ_DEVTOOLS'] == 'all': EXTRA_COMPONENTS += [ 'aboutdebugging-registration.js', 'aboutdebugging.manifest', 'aboutdevtoolstoolbox-registration.js', 'aboutdevtoolstoolbox.manifest', 'devtools-startup.js', 'devtools-startup.manifest', ] diff --git a/devtools/startup/tests/unit/.eslintrc.js b/devtools/startup/tests/unit/.eslintrc.js --- a/devtools/startup/tests/unit/.eslintrc.js +++ b/devtools/startup/tests/unit/.eslintrc.js @@ -1,21 +1,5 @@ -// This file was copied from the .eslintrc.xpcshell.js -// This new xpcshell test folder should stay in mozilla-central while devtools move to a -// GitHub repository, hence the duplication. +"use strict"; + module.exports = { - "extends": [ - "plugin:mozilla/xpcshell-test" - ], - "rules": { - // Allow non-camelcase so that run_test doesn't produce a warning. - "camelcase": "off", - // Allow using undefined variables so that tests can refer to functions - // and variables defined in head.js files, without having to maintain a - // list of globals in each .eslintrc file. - // Note that bug 1168340 will eventually help auto-registering globals - // from head.js files. - "no-undef": "off", - "block-scoped-var": "off", - // Tests can always import anything. - "mozilla/reject-some-requires": "off", - } + "extends": "../../../.eslintrc.xpcshell.js", }; diff --git a/devtools/startup/tests/unit/test_devtools_shim.js b/devtools/startup/tests/unit/test_devtools_shim.js --- a/devtools/startup/tests/unit/test_devtools_shim.js +++ b/devtools/startup/tests/unit/test_devtools_shim.js @@ -61,17 +61,17 @@ function checkCalls(mock, method, length `Devtools.${method} was called with the expected argument (index ${i})`); } } function test_register_unregister() { ok(!DevToolsShim.isInitialized(), "DevTools are not initialized"); DevToolsShim.register(createMockDevTools()); - ok(DevToolsShim.isInitialized(), "DevTools are installed"); + ok(DevToolsShim.isInitialized(), "DevTools are initialized"); DevToolsShim.unregister(); ok(!DevToolsShim.isInitialized(), "DevTools are not initialized"); } function test_on_is_forwarded_to_devtools() { ok(!DevToolsShim.isInitialized(), "DevTools are not initialized");