Bug 1511111 - Convert UrlClassifierSkipListService to static registration. r=kmag
authorJohann Hofmann <jhofmann@mozilla.com>
Fri, 08 Mar 2019 22:21:39 +0000
changeset 521203 325d88b1233348f9984e6059011b787bd4129529
parent 521202 5d96f8f2847e9992e7db9ac85b188ddfe1aa93ea
child 521204 70d4aa69497af554f9ec0d8d1036cb08f58d544d
push id10862
push userffxbld-merge
push dateMon, 11 Mar 2019 13:01:11 +0000
treeherdermozilla-beta@a2e7f5c935da [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskmag
bugs1511111
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 1511111 - Convert UrlClassifierSkipListService to static registration. r=kmag Differential Revision: https://phabricator.services.mozilla.com/D20318
browser/installer/package-manifest.in
mobile/android/installer/package-manifest.in
netwerk/url-classifier/UrlClassifierSkipListService.js
netwerk/url-classifier/UrlClassifierSkipListService.jsm
netwerk/url-classifier/UrlClassifierSkipListService.manifest
netwerk/url-classifier/components.conf
netwerk/url-classifier/moz.build
--- a/browser/installer/package-manifest.in
+++ b/browser/installer/package-manifest.in
@@ -215,20 +215,16 @@
 @RESPATH@/browser/components/extensions-browser.manifest
 
 ; Modules
 @RESPATH@/browser/modules/*
 @RESPATH@/modules/*
 @RESPATH@/browser/actors/*
 @RESPATH@/actors/*
 
-; Safe Browsing
-@RESPATH@/components/UrlClassifierSkipListService.js
-@RESPATH@/components/UrlClassifierSkipListService.manifest
-
 ; ANGLE GLES-on-D3D rendering library
 #ifdef MOZ_ANGLE_RENDERER
 @BINPATH@/libEGL.dll
 @BINPATH@/libGLESv2.dll
 
 #ifdef MOZ_D3DCOMPILER_VISTA_DLL
 @BINPATH@/@MOZ_D3DCOMPILER_VISTA_DLL@
 #endif
--- a/mobile/android/installer/package-manifest.in
+++ b/mobile/android/installer/package-manifest.in
@@ -134,20 +134,16 @@
 @BINPATH@/components/TestInterfaceJS.manifest
 @BINPATH@/components/TestInterfaceJSMaplike.js
 #endif
 
 ; Modules
 @BINPATH@/modules/*
 @BINPATH@/actors/*
 
-; Safe Browsing
-@BINPATH@/components/UrlClassifierSkipListService.js
-@BINPATH@/components/UrlClassifierSkipListService.manifest
-
 ; [Browser Chrome Files]
 @BINPATH@/chrome/toolkit@JAREXT@
 @BINPATH@/chrome/toolkit.manifest
 
 ; [Extensions]
 @BINPATH@/components/extensions-toolkit.manifest
 @BINPATH@/components/extensions-mobile.manifest
 
rename from netwerk/url-classifier/UrlClassifierSkipListService.js
rename to netwerk/url-classifier/UrlClassifierSkipListService.jsm
--- a/netwerk/url-classifier/UrlClassifierSkipListService.js
+++ b/netwerk/url-classifier/UrlClassifierSkipListService.jsm
@@ -1,15 +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.UrlClassifierSkipListService = function() {};
 
-const {XPCOMUtils} = ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
 const {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm");
 
 ChromeUtils.defineModuleGetter(this, "RemoteSettings",
                                "resource://services-settings/remote-settings.js");
 
 const COLLECTION_NAME = "url-classifier-skip-urls";
 
 class Feature {
@@ -78,17 +77,16 @@ class Feature {
       }
     }
   }
 }
 
 UrlClassifierSkipListService.prototype = Object.freeze({
   classID: Components.ID("{b9f4fd03-9d87-4bfd-9958-85a821750ddc}"),
   QueryInterface: ChromeUtils.generateQI([Ci.nsIUrlClassifierSkipListService]),
-  _xpcom_factory: XPCOMUtils.generateSingletonFactory(UrlClassifierSkipListService),
 
   features: {},
 
   registerAndRunSkipListObserver(feature, prefName, observer) {
     if (!this.features[feature]) {
       this.features[feature] = new Feature(feature, prefName);
     }
     this.features[feature].addObserver(observer);
@@ -97,9 +95,9 @@ UrlClassifierSkipListService.prototype =
   unregisterSkipListObserver(feature, observer) {
     if (!this.features[feature]) {
       return;
     }
     this.features[feature].removeObserver(observer);
   },
 });
 
-this.NSGetFactory = XPCOMUtils.generateNSGetFactory([UrlClassifierSkipListService]);
+var EXPORTED_SYMBOLS = ["UrlClassifierSkipListService"];
deleted file mode 100644
--- a/netwerk/url-classifier/UrlClassifierSkipListService.manifest
+++ /dev/null
@@ -1,2 +0,0 @@
-component {b9f4fd03-9d87-4bfd-9958-85a821750ddc} UrlClassifierSkipListService.js
-contract @mozilla.org/url-classifier/skip-list-service;1 {b9f4fd03-9d87-4bfd-9958-85a821750ddc}
new file mode 100644
--- /dev/null
+++ b/netwerk/url-classifier/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': '{b9f4fd03-9d87-4bfd-9958-85a821750ddc}',
+        'contract_ids': ['@mozilla.org/url-classifier/skip-list-service;1'],
+        'jsm': 'resource://gre/modules/UrlClassifierSkipListService.jsm',
+        'constructor': 'UrlClassifierSkipListService',
+    },
+]
--- a/netwerk/url-classifier/moz.build
+++ b/netwerk/url-classifier/moz.build
@@ -10,19 +10,22 @@ with Files('**'):
 XPIDL_SOURCES += [
     'nsIURIClassifier.idl',
     'nsIUrlClassifierFeature.idl',
     'nsIUrlClassifierSkipListService.idl',
 ]
 
 XPIDL_MODULE = 'url-classifier'
 
-EXTRA_COMPONENTS += [
-    'UrlClassifierSkipListService.js',
-    'UrlClassifierSkipListService.manifest',
+EXTRA_JS_MODULES += [
+    'UrlClassifierSkipListService.jsm',
+]
+
+XPCOM_MANIFESTS += [
+    'components.conf',
 ]
 
 DEFINES['GOOGLE_PROTOBUF_NO_RTTI'] = True
 DEFINES['GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER'] = True
 
 UNIFIED_SOURCES += [
     'AsyncUrlChannelClassifier.cpp',
     'nsChannelClassifier.cpp',