mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-13 21:35:39 +00:00
Bug 1479511 - modernize how TPS shuts down Firefox. r=tcsc
MozReview-Commit-ID: EzhGbhPCiOV Differential Revision: https://phabricator.services.mozilla.com/D2546 --HG-- extra : moz-landing-system : lando
This commit is contained in:
parent
aa9ae72062
commit
7d1bdec522
@ -31,23 +31,8 @@ function goQuitApplication() {
|
||||
return false;
|
||||
}
|
||||
|
||||
const kAppStartup = "@mozilla.org/toolkit/app-startup;1";
|
||||
const kAppShell = "@mozilla.org/appshell/appShellService;1";
|
||||
var appService;
|
||||
var forceQuit;
|
||||
|
||||
if (kAppStartup in Cc) {
|
||||
appService = Services.startup;
|
||||
forceQuit = Ci.nsIAppStartup.eForceQuit;
|
||||
} else if (kAppShell in Cc) {
|
||||
appService = Services.appShell;
|
||||
forceQuit = Ci.nsIAppShellService.eForceQuit;
|
||||
} else {
|
||||
throw new Error("goQuitApplication: no AppStartup/appShell");
|
||||
}
|
||||
|
||||
try {
|
||||
appService.quit(forceQuit);
|
||||
Services.startup.quit(Ci.nsIAppStartup.eForceQuit);
|
||||
} catch (ex) {
|
||||
throw new Error(`goQuitApplication: ${ex.message}`);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user