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:
Mark Hammond 2018-08-08 20:59:30 +00:00
parent aa9ae72062
commit 7d1bdec522

View File

@ -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}`);
}