Bug 1255511 - Skip beforeunload prompts once nsIAppStartup shuttingDown returns true. r=Gijs, a=ritu FIREFOX_46_0b4_BUILD2 FIREFOX_46_0b4_RELEASE
authorMike Conley <mconley@mozilla.com>
Tue, 15 Mar 2016 14:45:38 -0400
changeset 319409 2f6f69a19150e03ad68062f2ac92342afb1ef787
parent 319408 67f7b83a521fc25a3d3ab940416054bdc80c5431
child 319410 4f141612195dfdc9277620152386d70796527d63
push id1079
push userjlund@mozilla.com
push dateFri, 15 Apr 2016 21:02:33 +0000
treeherdermozilla-release@575fbf6786d5 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersGijs, ritu
bugs1255511
milestone46.0
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
@@ -6174,17 +6174,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;
     }