Bug 1481859 - Initialized PdfJs sharedData state earlier in startup. r=bdahl, a=pascalc
authorKris Maglione <maglione.k@gmail.com>
Sat, 25 Aug 2018 14:15:50 -0700
changeset 490277 b6b6ccb319ba
parent 490276 94ae3c41f785
child 490278 91955baf362b
push id9972
push userryanvm@gmail.com
push dateThu, 11 Oct 2018 20:01:18 +0000
treeherdermozilla-beta@91955baf362b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbdahl, pascalc
bugs1481859
milestone63.0
Bug 1481859 - Initialized PdfJs sharedData state earlier in startup. r=bdahl, a=pascalc Differential Revision: https://phabricator.services.mozilla.com/D4288
browser/components/nsBrowserGlue.js
browser/extensions/pdfjs/content/PdfJs.jsm
--- a/browser/components/nsBrowserGlue.js
+++ b/browser/components/nsBrowserGlue.js
@@ -1001,16 +1001,18 @@ BrowserGlue.prototype = {
     os.removeObserver(this, "shield-init-complete");
   },
 
   // runs on startup, before the first command line handler is invoked
   // (i.e. before the first window is opened)
   _beforeUIStartup: function BG__beforeUIStartup() {
     SessionStartup.init();
 
+    PdfJs.earlyInit();
+
     // check if we're in safe mode
     if (Services.appinfo.inSafeMode) {
       Services.ww.openWindow(null, "chrome://browser/content/safeMode.xul",
                              "_blank", "chrome,centerscreen,modal,resizable=no", null);
     }
 
     // apply distribution customizations
     this._distributionCustomizer.applyCustomizations();
--- a/browser/extensions/pdfjs/content/PdfJs.jsm
+++ b/browser/extensions/pdfjs/content/PdfJs.jsm
@@ -102,16 +102,20 @@ var PdfJs = {
                       "in the parent process.");
     }
     PdfjsChromeUtils.init();
     this.initPrefs();
 
     Services.ppmm.sharedData.set("pdfjs.enabled", this.checkEnabled());
   },
 
+  earlyInit() {
+    Services.ppmm.sharedData.set("pdfjs.enabled", this.checkEnabled());
+  },
+
   initPrefs: function initPrefs() {
     if (this._initialized) {
       return;
     }
     this._initialized = true;
 
     if (!getBoolPref(PREF_DISABLED, true)) {
       this._migrate();