[Pkg-javascript-commits] [pdf.js] 138/161: [Firefox] Only load 'PdfStreamConverter' and 'PdfRedirector' when PDF.js is enabled

David Prévot taffit at moszumanska.debian.org
Sat Apr 19 14:16:39 UTC 2014


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch master
in repository pdf.js.

commit 3fee5345b91cd2e249522f78d30e7c3d54621592
Author: Jonas Jenwald <jonas.jenwald at gmail.com>
Date:   Thu Mar 27 11:41:46 2014 +0100

    [Firefox] Only load 'PdfStreamConverter' and 'PdfRedirector' when PDF.js is enabled
---
 extensions/firefox/content/PdfJs.jsm | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/extensions/firefox/content/PdfJs.jsm b/extensions/firefox/content/PdfJs.jsm
index 6a8724c..c923ee6 100644
--- a/extensions/firefox/content/PdfJs.jsm
+++ b/extensions/firefox/content/PdfJs.jsm
@@ -34,8 +34,6 @@ const PDF_CONTENT_TYPE = 'application/pdf';
 
 Cu.import('resource://gre/modules/XPCOMUtils.jsm');
 Cu.import('resource://gre/modules/Services.jsm');
-Cu.import('resource://pdf.js/PdfStreamConverter.jsm');
-Cu.import('resource://pdf.js/PdfRedirector.jsm');
 
 let Svc = {};
 XPCOMUtils.defineLazyServiceGetter(Svc, 'mime',
@@ -246,10 +244,13 @@ let PdfJs = {
       return;
 
     this._pdfStreamConverterFactory = new Factory();
+    Cu.import('resource://pdf.js/PdfStreamConverter.jsm');
     this._pdfStreamConverterFactory.register(PdfStreamConverter);
 
     this._pdfRedirectorFactory = new Factory();
+    Cu.import('resource://pdf.js/PdfRedirector.jsm');
     this._pdfRedirectorFactory.register(PdfRedirector);
+
     Svc.pluginHost.registerPlayPreviewMimeType(PDF_CONTENT_TYPE, true,
       'data:application/x-moz-playpreview-pdfjs;,');
 
@@ -261,10 +262,13 @@ let PdfJs = {
       return;
 
     this._pdfStreamConverterFactory.unregister();
+    Cu.unload('resource://pdf.js/PdfStreamConverter.jsm');
     delete this._pdfStreamConverterFactory;
 
     this._pdfRedirectorFactory.unregister();
+    Cu.unload('resource://pdf.js/PdfRedirector.jsm');
     delete this._pdfRedirectorFactory;
+
     Svc.pluginHost.unregisterPlayPreviewMimeType(PDF_CONTENT_TYPE);
 
     this._registered = false;

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/pdf.js.git



More information about the Pkg-javascript-commits mailing list