Bug 1255511 - Skip beforeunload prompts once nsIAppStartup shuttingDown returns true. r=Gijs
authorMike Conley <mconley@mozilla.com>
Tue, 15 Mar 2016 14:45:38 -0400
changeset 288801 2eb222bbb28345c32180041dba9ca24e86db8da6
parent 288800 25bad67aed1c5fd5812965692b9b4993e2249e54
child 288802 4b048c4d03d89638616e3b733f6b2ae59023d5e7
push id73586
push usermconley@mozilla.com
push dateTue, 15 Mar 2016 22:11:27 +0000
treeherdermozilla-inbound@2eb222bbb283 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersGijs
bugs1255511
milestone48.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
Bug 1255511 - Skip beforeunload prompts once nsIAppStartup shuttingDown returns true. r=Gijs When the application is asked to quit, all windows are checked to see if they can close (which will spawn the permit unload dialogs). Once the user grants the quit via the permit unload dialogs, nsIAppStartup returns true for the shuttingDown attribute, and we know that all windows allowed the shutdown to occur. This means that we don't have to show the permitUnload dialogs again when SessionStore attempts to close the windows when it does its final async window flush during the quit-application-granted observer topic. MozReview-Commit-ID: DOy8ljngnTd
browser/base/content/browser.js
--- a/browser/base/content/browser.js
+++ b/browser/base/content/browser.js
@@ -6133,17 +6133,17 @@ var IndexedDBPromptHelper = {
     timeoutId = setTimeout(timeoutNotification, firstTimeoutDuration);
   }
 };
 
 function CanCloseWindow()
 {
   // Avoid redundant calls to canClose from showing multiple
   // PermitUnload dialogs.
-  if (window.skipNextCanClose) {
+  if (Services.startup.shuttingDown || window.skipNextCanClose) {
     return true;
   }
 
   for (let browser of gBrowser.browsers) {
     let {permitUnload, timedOut} = browser.permitUnload();
     if (timedOut) {
       return true;
     }