Bug 1524688: Part 52 - Convert WebVTT components to static registration. r=heycam
authorKris Maglione <maglione.k@gmail.com>
Wed, 30 Jan 2019 11:31:25 -0800
changeset 519991 f8fb6e47bb24093cb635cb475d1ff3df2d8697b0
parent 519990 280ea49c019b9bb8c19d265056e49a6ac08555d1
child 519992 5e4d951c88fdaf4a2be82dc8b855fbd5fd4f3644
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)
reviewersheycam
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 52 - Convert WebVTT components to static registration. r=heycam Differential Revision: https://phabricator.services.mozilla.com/D18462
browser/installer/package-manifest.in
dom/media/webvtt/WebVTT.manifest
dom/media/webvtt/WebVTTParserWrapper.js
dom/media/webvtt/WebVTTParserWrapper.jsm
dom/media/webvtt/components.conf
dom/media/webvtt/moz.build
mobile/android/installer/package-manifest.in
--- a/browser/installer/package-manifest.in
+++ b/browser/installer/package-manifest.in
@@ -160,18 +160,16 @@
 #endif
 
 ; JavaScript components
 @RESPATH@/browser/components/BrowserComponents.manifest
 @RESPATH@/browser/components/EnterprisePolicies.js
 @RESPATH@/browser/components/EnterprisePoliciesContent.js
 @RESPATH@/browser/components/EnterprisePolicies.manifest
 @RESPATH@/components/toolkitsearch.manifest
-@RESPATH@/components/WebVTT.manifest
-@RESPATH@/components/WebVTTParserWrapper.js
 @RESPATH@/components/extensions.manifest
 #ifdef MOZ_UPDATER
 @RESPATH@/components/nsUpdateService.manifest
 #endif
 @RESPATH@/components/ProcessSingleton.manifest
 @RESPATH@/components/HandlerService.manifest
 @RESPATH@/components/HandlerService.js
 #ifdef XP_MACOSX
deleted file mode 100644
--- a/dom/media/webvtt/WebVTT.manifest
+++ /dev/null
@@ -1,3 +0,0 @@
-# WebVTTParserWrapper
-component {acf6e493-0092-4b26-b172-241e375c57ab} WebVTTParserWrapper.js
-contract @mozilla.org/webvttParserWrapper;1 {acf6e493-0092-4b26-b172-241e375c57ab}
rename from dom/media/webvtt/WebVTTParserWrapper.js
rename to dom/media/webvtt/WebVTTParserWrapper.jsm
--- a/dom/media/webvtt/WebVTTParserWrapper.js
+++ b/dom/media/webvtt/WebVTTParserWrapper.jsm
@@ -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/. */
 
-const {XPCOMUtils} = ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
 const {WebVTT} = ChromeUtils.import("resource://gre/modules/vtt.jsm");
 
-var WEBVTTPARSERWRAPPER_CID = "{acf6e493-0092-4b26-b172-241e375c57ab}";
-
 function WebVTTParserWrapper()
 {
   // Nothing
 }
 
 WebVTTParserWrapper.prototype =
 {
   loadParser: function(window)
@@ -52,13 +49,12 @@ WebVTTParserWrapper.prototype =
   },
 
   processCues: function(window, cues, overlay, controls)
   {
     WebVTT.processCues(window, cues, overlay, controls);
   },
 
   classDescription: "Wrapper for the JS WebVTT implementation (vtt.js)",
-  classID: Components.ID(WEBVTTPARSERWRAPPER_CID),
   QueryInterface: ChromeUtils.generateQI([Ci.nsIWebVTTParserWrapper]),
 };
 
-this.NSGetFactory = XPCOMUtils.generateNSGetFactory([WebVTTParserWrapper]);
+var EXPORTED_SYMBOLS = ["WebVTTParserWrapper"];
new file mode 100644
--- /dev/null
+++ b/dom/media/webvtt/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': '{acf6e493-0092-4b26-b172-241e375c57ab}',
+        'contract_ids': ['@mozilla.org/webvttParserWrapper;1'],
+        'jsm': 'resource://gre/modules/WebVTTParserWrapper.jsm',
+        'constructor': 'WebVTTParserWrapper',
+    },
+]
--- a/dom/media/webvtt/moz.build
+++ b/dom/media/webvtt/moz.build
@@ -6,18 +6,21 @@
 
 XPIDL_SOURCES += [
   'nsIWebVTTListener.idl',
   'nsIWebVTTParserWrapper.idl',
 ]
 
 XPIDL_MODULE = 'webvtt'
 
-EXTRA_COMPONENTS += [
-  'WebVTT.manifest',
-  'WebVTTParserWrapper.js',
+EXTRA_JS_MODULES += [
+  'WebVTTParserWrapper.jsm',
+]
+
+XPCOM_MANIFESTS += [
+  'components.conf',
 ]
 
 EXTRA_JS_MODULES += [
   'vtt.jsm',
 ]
 
 XPCSHELL_TESTS_MANIFESTS += ['tests/xpcshell.ini']
--- a/mobile/android/installer/package-manifest.in
+++ b/mobile/android/installer/package-manifest.in
@@ -112,19 +112,16 @@
 @BINPATH@/components/amContentHandler.js
 @BINPATH@/components/amWebAPI.js
 @BINPATH@/components/amInstallTrigger.js
 #ifndef RELEASE_OR_BETA
 @BINPATH@/components/TabSource.js
 #endif
 #endif
 
-@BINPATH@/components/WebVTT.manifest
-@BINPATH@/components/WebVTTParserWrapper.js
-
 #ifndef MOZ_GECKOVIEW_JAR
 #ifdef MOZ_UPDATER
 @BINPATH@/components/nsUpdateService.manifest
 #endif
 #endif
 
 @BINPATH@/components/ProcessSingleton.manifest
 @BINPATH@/components/HandlerService.manifest