зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1489072: Fix startup perf regression in pdf.js init. r=bdahl
Differential Revision: https://phabricator.services.mozilla.com/D7649 --HG-- extra : rebase_source : 1a6b6ce514b79f29269812cc33d27be19ada1c02
This commit is contained in:
Родитель
86a5ba6453
Коммит
82935637f4
|
@ -11,6 +11,8 @@ ChromeUtils.import("resource://gre/modules/AppConstants.jsm");
|
|||
ChromeUtils.defineModuleGetter(this, "ActorManagerParent",
|
||||
"resource://gre/modules/ActorManagerParent.jsm");
|
||||
|
||||
const PREF_PDFJS_ENABLED_CACHE_STATE = "pdfjs.enabledCache.state";
|
||||
|
||||
let ACTORS = {
|
||||
AboutReader: {
|
||||
child: {
|
||||
|
@ -993,7 +995,13 @@ BrowserGlue.prototype = {
|
|||
_beforeUIStartup: function BG__beforeUIStartup() {
|
||||
SessionStartup.init();
|
||||
|
||||
PdfJs.earlyInit();
|
||||
if (Services.prefs.prefHasUserValue(PREF_PDFJS_ENABLED_CACHE_STATE)) {
|
||||
Services.ppmm.sharedData.set(
|
||||
"pdfjs.enabled",
|
||||
Services.prefs.getBoolPref(PREF_PDFJS_ENABLED_CACHE_STATE));
|
||||
} else {
|
||||
PdfJs.earlyInit();
|
||||
}
|
||||
|
||||
// check if we're in safe mode
|
||||
if (Services.appinfo.inSafeMode) {
|
||||
|
|
|
@ -108,6 +108,8 @@ var PdfJs = {
|
|||
},
|
||||
|
||||
earlyInit() {
|
||||
// Note: Please keep this in sync with the duplicated logic in
|
||||
// nsBrowserGlue.js.
|
||||
Services.ppmm.sharedData.set("pdfjs.enabled", this.checkEnabled());
|
||||
},
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче