Bug 1524688: Part 19 - Convert PDF.j to static registration. r=bdahl
☠☠ backed out by 3b1b94e39795 ☠ ☠
authorKris Maglione <maglione.k@gmail.com>
Tue, 29 Jan 2019 20:58:42 -0800
changeset 458992 d8efb5ed62b1
parent 458991 ea347d57d73a
child 458993 4ed0cf6be580
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)
reviewersbdahl
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 19 - Convert PDF.j to static registration. r=bdahl
browser/extensions/pdfjs/components.conf
browser/extensions/pdfjs/moz.build
browser/extensions/pdfjs/pdfjs.js
browser/extensions/pdfjs/pdfjs.manifest
browser/installer/package-manifest.in
new file mode 100644
--- /dev/null
+++ b/browser/extensions/pdfjs/components.conf
@@ -0,0 +1,17 @@
+# -*- 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': '{d0c5195d-e798-49d4-b1d3-9324328b2291}',
+        'contract_ids': [
+            '@mozilla.org/streamconv;1?from=application/pdf&to=*/*',
+            '@mozilla.org/streamconv;1?from=application/pdf&to=text/html',
+        ],
+        'jsm': 'resource:///modules/pdfjs.js',
+        'constructor': 'StreamConverterFactory',
+    },
+]
--- a/browser/extensions/pdfjs/moz.build
+++ b/browser/extensions/pdfjs/moz.build
@@ -6,12 +6,15 @@
 
 with Files("**"):
     BUG_COMPONENT = ("Firefox", "PDF Viewer")
 
 BROWSER_CHROME_MANIFESTS += ['test/browser.ini']
 
 JAR_MANIFESTS += ['jar.mn']
 
-EXTRA_COMPONENTS += [
+EXTRA_JS_MODULES += [
     'pdfjs.js',
-    'pdfjs.manifest',
 ]
+
+XPCOM_MANIFESTS += [
+    'components.conf',
+]
--- a/browser/extensions/pdfjs/pdfjs.js
+++ b/browser/extensions/pdfjs/pdfjs.js
@@ -11,27 +11,21 @@
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
 
 "use strict";
 
 const {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm");
-const {XPCOMUtils} = ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
 
 ChromeUtils.defineModuleGetter(this, "PdfStreamConverter",
   "resource://pdf.js/PdfStreamConverter.jsm");
 
 // Register/unregister a constructor as a factory.
 function StreamConverterFactory() {
   if (Services.cpmm.sharedData.get("pdfjs.enabled")) {
     return new PdfStreamConverter();
   }
   throw Cr.NS_ERROR_FACTORY_NOT_REGISTERED;
 }
-StreamConverterFactory.prototype = {
-  // properties required for XPCOM registration:
-  classID: Components.ID("{d0c5195d-e798-49d4-b1d3-9324328b2291}"),
-  classDescription: "pdf.js Component",
-};
 
-var NSGetFactory = XPCOMUtils.generateNSGetFactory([StreamConverterFactory]);
+var EXPORTED_SYMBOLS = ["StreamConverterFactory"];
deleted file mode 100644
--- a/browser/extensions/pdfjs/pdfjs.manifest
+++ /dev/null
@@ -1,3 +0,0 @@
-component {d0c5195d-e798-49d4-b1d3-9324328b2291} pdfjs.js
-contract @mozilla.org/streamconv;1?from=application/pdf&to=*/* {d0c5195d-e798-49d4-b1d3-9324328b2291}
-contract @mozilla.org/streamconv;1?from=application/pdf&to=text/html {d0c5195d-e798-49d4-b1d3-9324328b2291}
--- a/browser/installer/package-manifest.in
+++ b/browser/installer/package-manifest.in
@@ -301,20 +301,16 @@
 ; [Extensions]
 @RESPATH@/components/extensions-toolkit.manifest
 @RESPATH@/browser/components/extensions-browser.manifest
 
 ; [Normandy]
 @RESPATH@/components/shield.manifest
 @RESPATH@/components/shield-content-process.js
 
-; [PDF Viewer]
-@RESPATH@/browser/components/pdfjs.manifest
-@RESPATH@/browser/components/pdfjs.js
-
 ; Modules
 @RESPATH@/browser/modules/*
 @RESPATH@/modules/*
 @RESPATH@/browser/actors/*
 @RESPATH@/actors/*
 
 ; Security Reports
 @RESPATH@/components/SecurityReporter.manifest