Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(53)

Issue 11016023: Quickly close tabs/window with long-running unload handlers. (Closed)

Created:
8 years, 2 months ago by slamm
Modified:
7 years, 6 months ago
CC:
chromium-reviews, joi+watch-content_chromium.org, darin-cc_chromium.org, sreeram
Visibility:
Public.

Description

Changes to closing contents with beforeunload/unload handlers: - Closing a single tab, run beforeunload (if needed), then detached the tab from tab strip and close it asynchronously (no ui). - Closing a window, run all beforeunload handlers (same as before), then detach all tabs with unload handlers. Close any remaining tabs and hide the browser window while waiting for the unload handlers to complete. This CL started with fast-tab-closure and has grown to include fast-window-closure too. BUG=142458, 156896 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=195108 R=avi@chromium.org, ben@chromium.org Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=203922 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=205149

Patch Set 1 #

Patch Set 2 : Add test for one case (closing one of two tabs). #

Patch Set 3 : Wait for detached tabs to close. #

Total comments: 1

Patch Set 4 : Add tests. Drop test's use of non-public API. #

Total comments: 2

Patch Set 5 : Add UnloadController class comment. #

Total comments: 12

Patch Set 6 : Make UnloadDetachedHandler a delegate for all detached tabs. #

Total comments: 4

Patch Set 7 : Fast tab close *and* fast window close. #

Patch Set 8 : Keep original TabsNeedBeforeUnloadFired implementation. #

Total comments: 2

Patch Set 9 : Fix session restore from window-close. Workaround browser_tests needing valid window after close. #

Patch Set 10 : Pass tests by leaving existing flow intact. #

Patch Set 11 : Upload with --similarity 99 to add no_listeners.html properly. #

Patch Set 12 : Manage more unload states. Disable new CrashTab tests (related to http://crbug.com/168976?) #

Patch Set 13 : Add logging. #

Patch Set 14 : Rebase. #

Patch Set 15 : rebase #

Patch Set 16 : Fix compile error from rebase. #

Patch Set 17 : Fix compile error from rebase (take two). #

Patch Set 18 : Patch for landing #

Patch Set 19 : Patch for landing1 #

Patch Set 20 : Rebase off trunk #

Patch Set 21 : Properly cleanup registrar #

Total comments: 1

Patch Set 22 : Patch for landing #

Unified diffs Side-by-side diffs Delta from patch set Stats (+598 lines, -126 lines) Patch
M chrome/browser/ui/browser.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 2 chunks +7 lines, -3 lines 0 comments Download
M chrome/browser/ui/browser.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 3 chunks +8 lines, -6 lines 0 comments Download
M chrome/browser/ui/cocoa/browser_window_controller.mm View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 1 chunk +8 lines, -1 line 0 comments Download
M chrome/browser/ui/gtk/browser_window_gtk.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 1 chunk +7 lines, -0 lines 0 comments Download
M chrome/browser/ui/unload_controller.h View 1 2 3 4 5 6 7 8 9 10 11 12 18 19 20 6 chunks +70 lines, -28 lines 0 comments Download
M chrome/browser/ui/unload_controller.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 8 chunks +188 lines, -80 lines 0 comments Download
M chrome/browser/ui/views/frame/browser_view.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 1 chunk +7 lines, -0 lines 0 comments Download
M chrome/browser/unload_browsertest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 1 chunk +205 lines, -0 lines 0 comments Download
A + chrome/test/data/fast_tab_close/no_listeners.html View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 1 chunk +8 lines, -3 lines 0 comments Download
A chrome/test/data/fast_tab_close/unload_sets_cookie.html View 1 2 3 4 5 6 7 8 9 10 1 chunk +18 lines, -0 lines 0 comments Download
A chrome/test/data/fast_tab_close/unload_sleep_before_cookie.html View 1 2 3 4 5 6 7 8 9 10 1 chunk +28 lines, -0 lines 0 comments Download
M content/browser/web_contents/web_contents_impl.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 2 chunks +6 lines, -0 lines 0 comments Download
M content/browser/web_contents/web_contents_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 4 chunks +26 lines, -5 lines 0 comments Download
M content/public/browser/web_contents.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 1 chunk +12 lines, -0 lines 0 comments Download

Messages

Total messages: 33 (0 generated)
slamm
This is ready for review. This includes the quick fix for Issue 153945: "UMA Tab.Close ...
8 years, 2 months ago (2012-10-12 23:01:41 UTC) #1
ojan
This patch looks good to me, but it's been probably 4 years since I've touched ...
8 years, 2 months ago (2012-10-17 18:09:39 UTC) #2
slamm_google
Thank you for the comments. I will ask owners to take a look when I ...
8 years, 2 months ago (2012-10-17 23:25:10 UTC) #3
slamm
This change is ready to make tab closing faster. Close tabs with unload handlers in ...
8 years, 2 months ago (2012-10-25 00:11:01 UTC) #4
Ben Goodger (Google)
https://codereview.chromium.org/11016023/diff/20001/chrome/browser/ui/unload_controller.h File chrome/browser/ui/unload_controller.h (right): https://codereview.chromium.org/11016023/diff/20001/chrome/browser/ui/unload_controller.h#newcode28 chrome/browser/ui/unload_controller.h:28: class UnloadController : public content::NotificationObserver, It would be good ...
8 years, 1 month ago (2012-10-26 19:35:14 UTC) #5
slamm
I added a UnloadController class comment that gives an overview of how the class is ...
8 years, 1 month ago (2012-10-26 23:16:31 UTC) #6
Ben Goodger (Google)
https://codereview.chromium.org/11016023/diff/26001/chrome/browser/ui/unload_controller.h File chrome/browser/ui/unload_controller.h (right): https://codereview.chromium.org/11016023/diff/26001/chrome/browser/ui/unload_controller.h#newcode34 chrome/browser/ui/unload_controller.h:34: // If true, browser calls |contents::CloseWebContents()|. chrome::CloseWebContents() https://codereview.chromium.org/11016023/diff/26001/chrome/browser/ui/unload_controller.h#newcode35 chrome/browser/ui/unload_controller.h:35: ...
8 years, 1 month ago (2012-10-29 22:12:43 UTC) #7
slamm
I made the suggested changes. In the process, I found 3 bugs that I need ...
8 years, 1 month ago (2012-10-31 18:03:59 UTC) #8
Ben Goodger (Google)
OK. Let me know when you're done with those bugs. Here are a few minor ...
8 years, 1 month ago (2012-10-31 18:28:31 UTC) #9
slamm
I applied the suggested changes, fixed the bugs I mentioned, and fixed an issue with ...
8 years, 1 month ago (2012-11-10 01:58:01 UTC) #10
Ben Goodger (Google)
OK please ping back when you're done. I have about a week long codereview backlog ...
8 years, 1 month ago (2012-11-12 16:51:23 UTC) #11
slamm_google
This morning, I will make one more change that will lower the risk of breaking ...
8 years, 1 month ago (2012-11-12 17:01:14 UTC) #12
slamm
PTAL. This is ready to go. -slamm On 2012/11/12 17:01:14, slamm_google wrote: > This morning, ...
8 years, 1 month ago (2012-11-14 00:52:17 UTC) #13
Ben Goodger (Google)
Good stuff. I'm adding avi for the mac stuff and also your TC usage since ...
8 years, 1 month ago (2012-11-15 18:12:07 UTC) #14
Ben Goodger (Google)
+avi for real this time.
8 years, 1 month ago (2012-11-15 18:12:48 UTC) #15
ojan
FYI: the change description is out of date now.
8 years, 1 month ago (2012-11-15 18:45:45 UTC) #16
Avi (use Gerrit)
Not a fan of the TSM change, and I'm not the best for the Mac ...
8 years, 1 month ago (2012-11-15 18:56:43 UTC) #17
slamm_google
Ben, I rebased to HEAD on 11/12 and fixed conflicts related to TabContents going away. ...
8 years, 1 month ago (2012-11-15 22:20:36 UTC) #18
Ben Goodger (Google)
I'm willing to give general LGTM to this change, but would like for avi to ...
8 years, 1 month ago (2012-11-19 20:51:08 UTC) #19
Avi (use Gerrit)
On 2012/11/19 20:51:08, Ben Goodger (Google) wrote: > I'm willing to give general LGTM to ...
8 years, 1 month ago (2012-11-20 15:41:58 UTC) #20
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/slamm@chromium.org/11016023/49011
8 years, 1 month ago (2012-11-20 17:31:59 UTC) #21
commit-bot: I haz the power
Sorry for I got bad news for ya. Compile failed with a clobber build on ...
8 years, 1 month ago (2012-11-20 18:06:46 UTC) #22
slamm
The trybots revealed that a few debug tests fail because they assume the window does ...
8 years ago (2012-11-26 22:10:46 UTC) #23
Ben Goodger (Google)
Just discovered this still in my inbox. Do you need anything else here or are ...
8 years ago (2012-12-04 16:25:03 UTC) #24
slamm_google
Thank you for checking on this. I worked out a "perfect" fix except it failed ...
8 years ago (2012-12-04 17:31:52 UTC) #25
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/slamm@chromium.org/11016023/95001
7 years, 8 months ago (2013-04-18 17:09:02 UTC) #26
commit-bot: I haz the power
Sorry for I got bad news for ya. Compile failed with a clobber build on ...
7 years, 8 months ago (2013-04-18 18:11:17 UTC) #27
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/slamm@chromium.org/11016023/95001
7 years, 8 months ago (2013-04-18 18:26:02 UTC) #28
commit-bot: I haz the power
Change committed as 195108
7 years, 8 months ago (2013-04-19 08:48:45 UTC) #29
jeremy
Committed patchset #20 manually as r203922 (presubmit successful).
7 years, 6 months ago (2013-06-04 11:01:10 UTC) #30
Avi (use Gerrit)
Good luck with the recommit, though this is quite a bit out of my area ...
7 years, 6 months ago (2013-06-10 03:32:39 UTC) #31
jeremy
Committed patchset #22 manually as r205149 (presubmit successful).
7 years, 6 months ago (2013-06-10 05:40:54 UTC) #32
jam
7 years, 6 months ago (2013-06-18 16:23:58 UTC) #33
Message was sent while issue was closed.
On 2013/06/10 05:40:54, jeremy wrote:
> Committed patchset #22 manually as r205149 (presubmit successful).

I just saw this change from https://codereview.chromium.org/17382005/. i don't
think we should change webcontents this way, to add timing for chrome's usage.
chrome should just keep track of this timing on its own, without modifying
content.

Powered by Google App Engine
This is Rietveld 408576698