Bug 1386535 - Remove all DevTools shims used to support legacy add-ons. r=jryans draft
authorAlexandre Poirot <poirot.alex@gmail.com>
Tue, 26 Sep 2017 10:56:53 +0200
changeset 670540 0ea8bca463886c85574023a15b67f6a119f622af
parent 670404 bc56729898954e32d3a3731d03d178ed78924c33
child 670541 6b760231f983dceec0cb8dfb6e731baee19ad29a
child 670553 a710c84a3e14190f5c3ee61ac9958c0080f75fc6
child 671035 4410f27692edb95db7d65265c8abc73127ddfde2
push id81661
push userjdescottes@mozilla.com
push dateTue, 26 Sep 2017 15:57:21 +0000
reviewersjryans
bugs1386535
milestone58.0a1
Bug 1386535 - Remove all DevTools shims used to support legacy add-ons. r=jryans MozReview-Commit-ID: GemkTPQHl0L
browser/base/content/test/static/browser_all_files_referenced.js
devtools/client/moz.build
devtools/client/performance/components/test/head.js
devtools/client/shims/gDevTools.jsm
devtools/client/shims/moz.build
devtools/client/themes/shims/common.css
devtools/client/themes/shims/jar.mn
devtools/client/themes/shims/moz.build
devtools/server/moz.build
devtools/server/shims/moz.build
devtools/server/shims/protocol.js
devtools/server/shims/toolkit/dbg-server.jsm
devtools/server/shims/toolkit/moz.build
devtools/shared/moz.build
devtools/shared/shims/Console.jsm
devtools/shared/shims/Loader.jsm
devtools/shared/shims/dbg-client.jsm
devtools/shared/shims/event-emitter.js
devtools/shared/shims/fronts/moz.build
devtools/shared/shims/moz.build
--- a/browser/base/content/test/static/browser_all_files_referenced.js
+++ b/browser/base/content/test/static/browser_all_files_referenced.js
@@ -42,17 +42,16 @@ var whitelist = [
 
   // security/manager/pki/resources/content/device_manager.js
   {file: "chrome://pippki/content/load_device.xul"},
 
   // Used by setting this url as a pref in about:config
   {file: "chrome://browser/content/newtab/alternativeDefaultSites.json"},
 
   // Add-on compat
-  {file: "chrome://browser/skin/devtools/common.css"},
   {file: "chrome://global/content/XPCNativeWrapper.js"},
   {file: "chrome://global/locale/brand.dtd"},
 
   // The l10n build system can't package string files only for some platforms.
   // See bug 1339424 for why this is hard to fix.
   {file: "chrome://global/locale/fallbackMenubar.properties",
    platforms: ["linux", "win"]},
   {file: "chrome://global/locale/printPageSetup.dtd", platforms: ["macosx"]},
--- a/devtools/client/moz.build
+++ b/devtools/client/moz.build
@@ -21,30 +21,25 @@ DIRS += [
     'netmonitor',
     'performance',
     'preferences',
     'responsive.html',
     'responsivedesign',
     'scratchpad',
     'shadereditor',
     'shared',
-    'shims',
     'sourceeditor',
     'storage',
     'styleeditor',
     'themes',
     'webaudioeditor',
     'webconsole',
     'webide',
 ]
 
-# Shim old theme paths used by DevTools add-ons
-if CONFIG['MOZ_BUILD_APP'] == 'browser':
-    DIRS += ['themes/shims']
-
 JAR_MANIFESTS += ['jar.mn']
 
 DevToolsModules(
     'definitions.js',
     'menus.js',
 )
 
 with Files('**'):
--- a/devtools/client/performance/components/test/head.js
+++ b/devtools/client/performance/components/test/head.js
@@ -3,17 +3,17 @@
    http://creativecommons.org/publicdomain/zero/1.0/ */
 "use strict";
 
 /* global window, document, SimpleTest, requestAnimationFrame, is, ok */
 /* exported Cc, Ci, Cu, Cr, Assert, Task, TargetFactory, Toolbox, browserRequire,
    forceRender, setProps, dumpn, checkOptimizationHeader, checkOptimizationTree */
 let { classes: Cc, interfaces: Ci, utils: Cu, results: Cr } = Components;
 
-let { require } = Cu.import("resource://gre/modules/devtools/shared/Loader.jsm", {});
+let { require } = Cu.import("resource://devtools/shared/Loader.jsm", {});
 let { Assert } = require("resource://testing-common/Assert.jsm");
 let { BrowserLoader } = Cu.import("resource://devtools/client/shared/browser-loader.js", {});
 let defer = require("devtools/shared/defer");
 let flags = require("devtools/shared/flags");
 let { Task } = require("devtools/shared/task");
 let { TargetFactory } = require("devtools/client/framework/target");
 let { Toolbox } = require("devtools/client/framework/toolbox");
 
deleted file mode 100644
--- a/devtools/client/shims/gDevTools.jsm
+++ /dev/null
@@ -1,35 +0,0 @@
-/* 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/. */
-
-"use strict";
-
-/**
- * This file only exists to support add-ons which import this module at a
- * specific path.
- */
-
-const Cu = Components.utils;
-
-const { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
-
-const WARNING_PREF = "devtools.migration.warnings";
-if (Services.prefs.getBoolPref(WARNING_PREF)) {
-  const { Deprecated } = Cu.import("resource://gre/modules/Deprecated.jsm", {});
-  Deprecated.warning("This path to gDevTools.jsm is deprecated.  Please use " +
-                     "Cu.import(\"resource://devtools/client/" +
-                     "framework/gDevTools.jsm\") to load this module.",
-                     "https://bugzil.la/912121");
-}
-
-this.EXPORTED_SYMBOLS = [
-  "gDevTools",
-  "gDevToolsBrowser"
-];
-
-const module =
-  Cu.import("resource://devtools/client/framework/gDevTools.jsm", {});
-
-for (let symbol of this.EXPORTED_SYMBOLS) {
-  this[symbol] = module[symbol];
-}
deleted file mode 100644
--- a/devtools/client/shims/moz.build
+++ /dev/null
@@ -1,14 +0,0 @@
-# -*- 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/.
-
-# Unlike most DevTools build files, this file does not use DevToolsModules
-# because these files are here for add-on compatibility, and so they must be
-# installed to previously defined locations.
-
-EXTRA_JS_MODULES.devtools += [
-    'devtools.js',
-    'gDevTools.jsm',
-]
deleted file mode 100644
--- a/devtools/client/themes/shims/common.css
+++ /dev/null
@@ -1,10 +0,0 @@
-/* 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 file only exists to support add-ons which import this style sheet at a
-  * specific path.
-  */
-
-@import url("resource://devtools/client/themes/common.css");
deleted file mode 100644
--- a/devtools/client/themes/shims/jar.mn
+++ /dev/null
@@ -1,6 +0,0 @@
-# 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/.
-
-browser.jar:
-    skin/classic/browser/devtools/common.css (common.css)
deleted file mode 100644
--- a/devtools/client/themes/shims/moz.build
+++ /dev/null
@@ -1,8 +0,0 @@
-# -*- 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/.
-
-# Shim old theme paths used by DevTools add-ons
-JAR_MANIFESTS += ['jar.mn']
--- a/devtools/server/moz.build
+++ b/devtools/server/moz.build
@@ -4,17 +4,16 @@
 # 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/.
 
 include('../templates.mozbuild')
 
 DIRS += [
     'actors',
     'performance',
-    'shims',
 ]
 
 BROWSER_CHROME_MANIFESTS += ['tests/browser/browser.ini']
 MOCHITEST_CHROME_MANIFESTS += ['tests/mochitest/chrome.ini']
 XPCSHELL_TESTS_MANIFESTS += ['tests/unit/xpcshell.ini']
 
 DevToolsModules(
     'child.js',
deleted file mode 100644
--- a/devtools/server/shims/moz.build
+++ /dev/null
@@ -1,18 +0,0 @@
-# -*- 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/.
-
-DIRS += [
-    'toolkit',
-]
-
-# Unlike most DevTools build files, this file does not use DevToolsModules
-# because these files are here for add-on compatibility, and so they must be
-# installed to previously defined locations.
-
-# Extra compatibility layer for old path after relocation in bug 1270173
-FINAL_TARGET_FILES.chrome.devtools.modules.devtools.server += [
-    'protocol.js',
-]
deleted file mode 100644
--- a/devtools/server/shims/protocol.js
+++ /dev/null
@@ -1,24 +0,0 @@
-/* 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/. */
-
-"use strict";
-
-/**
- * This file only exists to support add-ons which import this module at a
- * specific path.
- */
-
-const { Cu } = require("chrome");
-const Services = require("Services");
-
-const WARNING_PREF = "devtools.migration.warnings";
-if (Services.prefs.getBoolPref(WARNING_PREF)) {
-  const { Deprecated } = Cu.import("resource://gre/modules/Deprecated.jsm", {});
-  Deprecated.warning("This path to protocol.js is deprecated. Please use " +
-                     "require(\"devtools/shared/protocol\") to load this " +
-                     "module.",
-                     "https://bugzil.la/1270173");
-}
-
-module.exports = require("devtools/shared/protocol");
deleted file mode 100644
--- a/devtools/server/shims/toolkit/dbg-server.jsm
+++ /dev/null
@@ -1,37 +0,0 @@
-/* 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/. */
-
-"use strict";
-
-/**
- * This file only exists to support add-ons which import this module at a
- * specific path.
- */
-
-const Cu = Components.utils;
-
-const { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
-
-const WARNING_PREF = "devtools.migration.warnings";
-if (Services.prefs.getBoolPref(WARNING_PREF)) {
-  const { Deprecated } = Cu.import("resource://gre/modules/Deprecated.jsm", {});
-  Deprecated.warning("dbg-server.jsm is deprecated.  Please use " +
-                     "require(\"devtools/server/main\") to load this " +
-                     "module.",
-                     "https://bugzil.la/912121");
-}
-
-this.EXPORTED_SYMBOLS = [
-  "DebuggerServer",
-  "ActorPool",
-  "OriginalLocation",
-];
-
-const { require } =
-  Cu.import("resource://devtools/shared/Loader.jsm", {});
-const module = require("devtools/server/main");
-
-for (let symbol of this.EXPORTED_SYMBOLS) {
-  this[symbol] = module[symbol];
-}
deleted file mode 100644
--- a/devtools/server/shims/toolkit/moz.build
+++ /dev/null
@@ -1,17 +0,0 @@
-# -*- 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/.
-
-# Unlike most DevTools build files, this file does not use DevToolsModules
-# because these files are here for add-on compatibility, and so they must be
-# installed to previously defined locations.
-
-# These shims for legacy paths expect to be installed as if they were part of
-# /toolkit modules.  Disable any DIST_SUBDIR from parent files here.
-DIST_SUBDIR = ''
-
-EXTRA_JS_MODULES.devtools += [
-    'dbg-server.jsm',
-]
--- a/devtools/shared/moz.build
+++ b/devtools/shared/moz.build
@@ -22,17 +22,16 @@ DIRS += [
     'node-properties',
     'performance',
     'platform',
     'pretty-fast',
     'qrcode',
     'security',
     'sourcemap',
     'sprintfjs',
-    'shims',
     'specs',
     'touch',
     'transport',
     'webconsole',
     'worker',
 ]
 
 BROWSER_CHROME_MANIFESTS += ['tests/browser/browser.ini']
deleted file mode 100644
--- a/devtools/shared/shims/Console.jsm
+++ /dev/null
@@ -1,35 +0,0 @@
-/* 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/. */
-
-"use strict";
-
-/**
- * This file only exists to support add-ons which import this module at a
- * specific path.
- */
-
-const Cu = Components.utils;
-
-const { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
-
-const WARNING_PREF = "devtools.migration.warnings";
-if (Services.prefs.getBoolPref(WARNING_PREF)) {
-  const { Deprecated } = Cu.import("resource://gre/modules/Deprecated.jsm", {});
-  Deprecated.warning("This path to Console.jsm is deprecated.  Please use " +
-                     "Cu.import(\"resource://gre/modules/Console.jsm\") " +
-                     "to load this module.",
-                     "https://bugzil.la/912121");
-}
-
-this.EXPORTED_SYMBOLS = [
-  "console",
-  "ConsoleAPI"
-];
-
-const module =
-  Cu.import("resource://gre/modules/Console.jsm", {});
-
-for (let symbol of this.EXPORTED_SYMBOLS) {
-  this[symbol] = module[symbol];
-}
deleted file mode 100644
--- a/devtools/shared/shims/Loader.jsm
+++ /dev/null
@@ -1,38 +0,0 @@
-/* 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/. */
-
-"use strict";
-
-/**
- * This file only exists to support add-ons which import this module at a
- * specific path.
- */
-
-const Cu = Components.utils;
-
-const { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
-
-const WARNING_PREF = "devtools.migration.warnings";
-if (Services.prefs.getBoolPref(WARNING_PREF)) {
-  const { Deprecated } = Cu.import("resource://gre/modules/Deprecated.jsm", {});
-  Deprecated.warning("This path to Loader.jsm is deprecated.  Please use " +
-                     "Cu.import(\"resource://devtools/shared/" +
-                     "Loader.jsm\") to load this module.",
-                     "https://bugzil.la/912121");
-}
-
-this.EXPORTED_SYMBOLS = [
-  "DevToolsLoader",
-  "devtools",
-  "BuiltinProvider",
-  "require",
-  "loader"
-];
-
-const module =
-  Cu.import("resource://devtools/shared/Loader.jsm", {});
-
-for (let symbol of this.EXPORTED_SYMBOLS) {
-  this[symbol] = module[symbol];
-}
deleted file mode 100644
--- a/devtools/shared/shims/dbg-client.jsm
+++ /dev/null
@@ -1,43 +0,0 @@
-/* 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/. */
-
-"use strict";
-
-/**
- * This file only exists to support add-ons which import this module at a
- * specific path.
- */
-
-const Cu = Components.utils;
-
-const { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
-
-const WARNING_PREF = "devtools.migration.warnings";
-if (Services.prefs.getBoolPref(WARNING_PREF)) {
-  const { Deprecated } = Cu.import("resource://gre/modules/Deprecated.jsm", {});
-  Deprecated.warning("dbg-client.jsm is deprecated.  Please use " +
-                     "require(\"devtools/shared/client/main\") to load this " +
-                     "module.", "https://bugzil.la/912121");
-}
-
-const { require } =
-  Cu.import("resource://devtools/shared/Loader.jsm", {});
-
-this.EXPORTED_SYMBOLS = ["DebuggerTransport",
-                         "DebuggerClient",
-                         "RootClient",
-                         "LongStringClient",
-                         "EnvironmentClient",
-                         "ObjectClient"];
-
-var client = require("devtools/shared/client/main");
-
-this.DebuggerClient = client.DebuggerClient;
-this.RootClient = client.RootClient;
-this.LongStringClient = client.LongStringClient;
-this.EnvironmentClient = client.EnvironmentClient;
-this.ObjectClient = client.ObjectClient;
-
-this.DebuggerTransport =
-  require("devtools/shared/transport/transport").DebuggerTransport;
deleted file mode 100644
--- a/devtools/shared/shims/event-emitter.js
+++ /dev/null
@@ -1,45 +0,0 @@
-/* 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/. */
-
-"use strict";
-
-/**
- * This file only exists to support add-ons which import this module at a
- * specific path.
- */
-
-(function (factory) {
-  // Module boilerplate
-  if (this.module && module.id.indexOf("event-emitter") >= 0) {
-    // require
-    factory.call(this, require, exports, module);
-  } else {
-    // Cu.import
-    const Cu = Components.utils;
-    const { require } =
-      Cu.import("resource://devtools/shared/Loader.jsm", {});
-    this.isWorker = false;
-    this.promise = Cu.import("resource://gre/modules/Promise.jsm", {}).Promise;
-    factory.call(this, require, this, { exports: this });
-    this.EXPORTED_SYMBOLS = ["EventEmitter"];
-  }
-}).call(this, function (require, exports, module) {
-  const { Cu } = require("chrome");
-  const Services = require("Services");
-  const WARNING_PREF = "devtools.migration.warnings";
-  // Cu and Services aren't accessible from workers
-  if (Cu && Services && Services.prefs &&
-      Services.prefs.getBoolPref(WARNING_PREF)) {
-    const { Deprecated } =
-      Cu.import("resource://gre/modules/Deprecated.jsm", {});
-    Deprecated.warning("This path to event-emitter.js is deprecated.  Please " +
-                       "use require(\"devtools/shared/old-event-emitter\") to " +
-                       "load this module.",
-                       "https://bugzil.la/912121");
-  }
-
-  const EventEmitter = require("devtools/shared/old-event-emitter");
-  this.EventEmitter = EventEmitter;
-  module.exports = EventEmitter;
-});
deleted file mode 100644
--- a/devtools/shared/shims/fronts/moz.build
+++ /dev/null
@@ -1,9 +0,0 @@
-# -*- 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/.
-
-DevToolsModules(
-    'timeline.js',
-)
deleted file mode 100644
--- a/devtools/shared/shims/moz.build
+++ /dev/null
@@ -1,28 +0,0 @@
-# -*- 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/.
-
-# Unlike most DevTools build files, this file does not use DevToolsModules
-# because these files are here for add-on compatibility, and so they must be
-# installed to previously defined locations.
-
-# These shims for legacy paths expect to be installed as if they were part of
-# /toolkit modules.  Disable any DIST_SUBDIR from parent files here.
-DIST_SUBDIR = ''
-
-DIRS += [
-    'fronts',
-]
-EXTRA_JS_MODULES.devtools += [
-    'Console.jsm',
-    'dbg-client.jsm',
-    'event-emitter.js',
-    'Loader.jsm',
-]
-
-# Extra compatibility layer for transitional URLs used for part of 44 cycle
-EXTRA_JS_MODULES.devtools.shared += [
-    'Loader.jsm',
-]