Bug 1255511 - Skip beforeunload prompts once nsIAppStartup shuttingDown returns true. r=Gijs, a=ritu
authorMike Conley <mconley@mozilla.com>
Tue, 15 Mar 2016 14:45:38 -0400
changeset 325441 f971cddcd1d01cdf8b5117ffa91c0d2efc052c8b
parent 325440 7326d5f35563d93563e0e109defa4a6f895610de
child 325442 7c515321a7408fc184a3545e71fb5faa14418ce0
push id1128
push userjlund@mozilla.com
push dateWed, 01 Jun 2016 01:31:59 +0000
treeherdermozilla-release@fe0d30de989d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersGijs, ritu
bugs1255511
milestone47.0a2
Bug 1255511 - Skip beforeunload prompts once nsIAppStartup shuttingDown returns true. r=Gijs, a=ritu 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
@@ -6119,17 +6119,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;
     }