Bug 1524688: Part 56 - Convert contentAreaDropsListener to static registration. r=mconley
☠☠ backed out by 3b1b94e39795 ☠ ☠
authorKris Maglione <maglione.k@gmail.com>
Wed, 30 Jan 2019 11:37:53 -0800
changeset 459027 230d2feaf941
parent 459026 6c63bc240972
child 459028 b4938f2ff8fd
push id111909
push usermaglione.k@gmail.com
push dateThu, 14 Feb 2019 02:30:40 +0000
treeherdermozilla-inbound@81dc12cc9257 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmconley
bugs1524688
milestone67.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1524688: Part 56 - Convert contentAreaDropsListener to static registration. r=mconley Differential Revision: https://phabricator.services.mozilla.com/D18466
browser/installer/package-manifest.in
dom/base/ContentAreaDropListener.jsm
dom/base/components.conf
dom/base/contentAreaDropListener.js
dom/base/contentAreaDropListener.manifest
dom/base/moz.build
mobile/android/installer/package-manifest.in
--- a/browser/installer/package-manifest.in
+++ b/browser/installer/package-manifest.in
@@ -189,18 +189,16 @@
 @RESPATH@/components/nsHelperAppDlg.js
 @RESPATH@/components/extensions.manifest
 #ifdef MOZ_UPDATER
 @RESPATH@/components/nsUpdateService.manifest
 #endif
 @RESPATH@/components/ProcessSingleton.manifest
 @RESPATH@/components/nsContentDispatchChooser.manifest
 @RESPATH@/components/nsContentDispatchChooser.js
-@RESPATH@/components/contentAreaDropListener.manifest
-@RESPATH@/components/contentAreaDropListener.js
 @RESPATH@/components/HandlerService.manifest
 @RESPATH@/components/HandlerService.js
 #ifdef XP_MACOSX
 @RESPATH@/browser/components/MacTouchBar.manifest
 @RESPATH@/browser/components/MacTouchBar.js
 #endif
 @RESPATH@/components/SyncComponents.manifest
 @RESPATH@/components/servicesComponents.manifest
rename from dom/base/contentAreaDropListener.js
rename to dom/base/ContentAreaDropListener.jsm
--- a/dom/base/contentAreaDropListener.js
+++ b/dom/base/ContentAreaDropListener.jsm
@@ -1,14 +1,13 @@
 /* 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/. */
 
 const {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm");
-const {XPCOMUtils} = ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
 const {OS} = ChromeUtils.import("resource://gre/modules/osfile.jsm");
 
 // This component is used for handling dragover and drop of urls.
 //
 // It checks to see whether a drop of a url is allowed. For instance, a url
 // cannot be dropped if it is not a valid uri or the source of the drag cannot
 // access the uri. This prevents, for example, a source document from tricking
 // the user into dragging a chrome url.
@@ -310,10 +309,9 @@ ContentAreaDropListener.prototype =
       return false;
 
     return ownerDoc.defaultView
                    .windowUtils
                    .isNodeDisabledForEvents(aEvent.originalTarget);
   }
 };
 
-var components = [ContentAreaDropListener];
-this.NSGetFactory = XPCOMUtils.generateNSGetFactory(components);
+var EXPORTED_SYMBOLS = ["ContentAreaDropListener"];
new file mode 100644
--- /dev/null
+++ b/dom/base/components.conf
@@ -0,0 +1,14 @@
+# -*- 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/.
+
+Classes = [
+    {
+        'cid': '{1f34bc80-1bc7-11d6-a384-d705dd0746fc}',
+        'contract_ids': ['@mozilla.org/content/dropped-link-handler;1'],
+        'jsm': 'resource://gre/modules/ContentAreaDropListener.jsm',
+        'constructor': 'ContentAreaDropListener',
+    },
+]
deleted file mode 100644
--- a/dom/base/contentAreaDropListener.manifest
+++ /dev/null
@@ -1,2 +0,0 @@
-component {1f34bc80-1bc7-11d6-a384-d705dd0746fc} contentAreaDropListener.js
-contract @mozilla.org/content/dropped-link-handler;1 {1f34bc80-1bc7-11d6-a384-d705dd0746fc}
--- a/dom/base/moz.build
+++ b/dom/base/moz.build
@@ -448,29 +448,32 @@ SOURCES += [
 
 # Are we targeting x86-32 or x86-64?  If so, we want to include SSE2 code for
 # nsTextFragment.cpp
 if CONFIG['INTEL_ARCHITECTURE']:
     SOURCES += ['nsTextFragmentSSE2.cpp']
     SOURCES['nsTextFragmentSSE2.cpp'].flags += CONFIG['SSE2_FLAGS']
 
 EXTRA_COMPONENTS += [
-    'contentAreaDropListener.js',
-    'contentAreaDropListener.manifest',
     'ProcessSelector.js',
     'ProcessSelector.manifest',
     'SlowScriptDebug.js',
     'SlowScriptDebug.manifest',
 ]
 
 EXTRA_JS_MODULES += [
+    'ContentAreaDropListener.jsm',
     'DOMRequestHelper.jsm',
     'IndexedDBHelper.jsm',
 ]
 
+XPCOM_MANIFESTS += [
+    'components.conf',
+]
+
 LOCAL_INCLUDES += [
     '../battery',
     '../events',
     '../media',
     '../network',
     '/caps',
     '/docshell/base',
     '/dom/base',
--- a/mobile/android/installer/package-manifest.in
+++ b/mobile/android/installer/package-manifest.in
@@ -124,18 +124,16 @@
 #ifdef MOZ_UPDATER
 @BINPATH@/components/nsUpdateService.manifest
 #endif
 #endif
 
 @BINPATH@/components/ProcessSingleton.manifest
 @BINPATH@/components/HandlerService.manifest
 @BINPATH@/components/HandlerService.js
-@BINPATH@/components/contentAreaDropListener.manifest
-@BINPATH@/components/contentAreaDropListener.js
 @BINPATH@/components/servicesComponents.manifest
 @BINPATH@/components/servicesSettings.manifest
 
 #if defined(ENABLE_TESTS) && defined(MOZ_DEBUG)
 @BINPATH@/components/TestInterfaceJS.js
 @BINPATH@/components/TestInterfaceJS.manifest
 @BINPATH@/components/TestInterfaceJSMaplike.js
 #endif