author | Gijs Kruitbosch <gijskruitbosch@gmail.com> |
Wed, 05 Aug 2015 17:59:00 +0100 | |
changeset 256591 | 0f220ddcc60b427d057b9fa73fc2671740b818d0 |
parent 256590 | 942ac3261a6999fa6f52fe0ea97ce56266cd35a1 |
child 256592 | 9fc0f0ba0cca12c09379aa95bdb798ac0fc937be |
push id | 29180 |
push user | kwierso@gmail.com |
push date | Fri, 07 Aug 2015 00:23:32 +0000 |
treeherder | mozilla-central@b735f4eea935 [default view] [failures only] |
perfherder | [talos] [build metrics] [platform microbench] (compared to previous push) |
reviewers | Mossop |
bugs | 1185294 |
milestone | 42.0a1 |
first release with | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
last release without | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
--- a/toolkit/modules/BrowserUtils.jsm +++ b/toolkit/modules/BrowserUtils.jsm @@ -25,16 +25,22 @@ this.BrowserUtils = { /** * restartApplication: Restarts the application, keeping it in * safe mode if it is already in safe mode. */ restartApplication: function() { let appStartup = Cc["@mozilla.org/toolkit/app-startup;1"] .getService(Ci.nsIAppStartup); + let cancelQuit = Cc["@mozilla.org/supports-PRBool;1"] + .createInstance(Ci.nsISupportsPRBool); + Services.obs.notifyObservers(cancelQuit, "quit-application-requested", "restart"); + if (cancelQuit.data) { // The quit request has been canceled. + return false; + } //if already in safe mode restart in safe mode if (Services.appinfo.inSafeMode) { appStartup.restartInSafeMode(Ci.nsIAppStartup.eAttemptQuit | Ci.nsIAppStartup.eRestart); return; } appStartup.quit(Ci.nsIAppStartup.eAttemptQuit | Ci.nsIAppStartup.eRestart); },