Bug 1379788 - Stop loading RecentWindow.jsm during startup, r=Gijs.

This commit is contained in:
Florian Quèze 2017-07-11 23:30:23 +02:00
parent b9b1a8454e
commit 3d56aac575
4 changed files with 12 additions and 12 deletions

View File

@ -70,6 +70,7 @@ const startupPhases = {
modules: new Set([
"resource:///modules/AboutNewTab.jsm",
"resource:///modules/DirectoryLinksProvider.jsm",
"resource:///modules/RecentWindow.jsm",
"resource://gre/modules/BookmarkHTMLUtils.jsm",
"resource://gre/modules/Bookmarks.jsm",
"resource://gre/modules/ContextualIdentityService.jsm",

View File

@ -8,7 +8,9 @@ Components.utils.import("resource://gre/modules/AppConstants.jsm");
Components.utils.import("resource://gre/modules/Services.jsm");
Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");
Components.utils.import("resource://gre/modules/PrivateBrowsingUtils.jsm");
Components.utils.import("resource:///modules/RecentWindow.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "RecentWindow",
"resource:///modules/RecentWindow.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "ShellService",
"resource:///modules/ShellService.jsm");

View File

@ -305,17 +305,14 @@ this.BrowserUITelemetry = {
// our measurements because at that point all browser windows have
// probably been closed, since the vast majority of saved-session
// pings are gathered during shutdown.
let win = RecentWindow.getMostRecentBrowserWindow({
private: false,
allowPopups: false,
});
Services.search.init(rv => {
// If there are no such windows (or we've just about found one
// but it's closed already), we're out of luck. :(
let hasWindow = win && !win.closed;
this._firstWindowMeasurements = hasWindow ? this._getWindowMeasurements(win, rv)
: {};
let win = RecentWindow.getMostRecentBrowserWindow({
private: false,
allowPopups: false,
});
// If there are no such windows, we're out of luck. :(
this._firstWindowMeasurements = win ? this._getWindowMeasurements(win, rv)
: {};
});
},

View File

@ -47,7 +47,7 @@ this.ExtensionsUI = {
Services.obs.addObserver(this, "webextension-install-notify");
Services.obs.addObserver(this, "webextension-optional-permission-prompt");
await RecentWindow.getMostRecentBrowserWindow().delayedStartupPromise;
await Services.wm.getMostRecentWindow("navigator:browser").delayedStartupPromise;
this._checkForSideloaded();
},