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

Issue 2681203002: Add Browser::SkipCallBeforeUnload so that the browser windows can be closed regardless of beforeunl… (Closed)

Created:
3 years, 10 months ago by zmin
Modified:
3 years, 9 months ago
Reviewers:
Charlie Reis, *sky
CC:
chromium-reviews
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Add Browser::SkipCallBeforeUnload so that the browser windows can be closed regardless of beforeunload events. This function will be used when force-sign-in policy is enabled. When the auth token become invalid, this policy will close all browser windows, sign out user and display UserManager. Implement this function so that the window closing process won't be blocked by the webpage contains onbeforeunload event. BUG=642059 Review-Url: https://codereview.chromium.org/2681203002 Cr-Commit-Position: refs/heads/master@{#457206} Committed: https://chromium.googlesource.com/chromium/src/+/9ea988f681de3e681c720e6046ceea96a0659783

Patch Set 1 #

Patch Set 2 : refactor #

Total comments: 3

Patch Set 3 : sky's comments #

Total comments: 1

Patch Set 4 : comments #

Total comments: 18

Patch Set 5 : Charlie's comments #

Patch Set 6 : rebase from master #

Total comments: 18

Patch Set 7 : cr #

Patch Set 8 : cr - remove delegate in UnloadController #

Unified diffs Side-by-side diffs Delta from patch set Stats (+372 lines, -165 lines) Patch
M chrome/browser/lifetime/browser_close_manager.cc View 1 2 3 4 5 6 2 chunks +4 lines, -4 lines 0 comments Download
M chrome/browser/profiles/profile_manager.cc View 1 2 3 4 5 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/profiles/profile_window.cc View 1 3 chunks +3 lines, -3 lines 0 comments Download
M chrome/browser/signin/chrome_signin_client.cc View 1 2 3 4 1 chunk +5 lines, -3 lines 0 comments Download
M chrome/browser/ui/BUILD.gn View 1 2 3 4 5 6 1 chunk +2 lines, -0 lines 0 comments Download
M chrome/browser/ui/browser.h View 1 2 3 4 5 6 1 chunk +14 lines, -9 lines 0 comments Download
M chrome/browser/ui/browser.cc View 1 2 3 4 5 1 chunk +9 lines, -8 lines 0 comments Download
M chrome/browser/ui/browser_list.h View 1 2 3 4 2 chunks +21 lines, -16 lines 0 comments Download
M chrome/browser/ui/browser_list.cc View 1 2 3 4 5 chunks +34 lines, -24 lines 0 comments Download
M chrome/browser/ui/fast_unload_controller.h View 1 2 3 4 5 chunks +12 lines, -9 lines 0 comments Download
M chrome/browser/ui/fast_unload_controller.cc View 1 2 3 4 5 6 9 chunks +60 lines, -62 lines 0 comments Download
M chrome/browser/ui/startup/startup_browser_creator_corrupt_profiles_browsertest_win.cc View 1 1 chunk +3 lines, -3 lines 0 comments Download
M chrome/browser/ui/unload_controller.h View 1 2 3 4 5 6 7 4 chunks +9 lines, -6 lines 0 comments Download
M chrome/browser/ui/unload_controller.cc View 1 2 3 4 5 6 7 7 chunks +18 lines, -10 lines 0 comments Download
A chrome/browser/ui/unload_controller_web_contents_delegate.h View 1 2 3 4 5 6 1 chunk +28 lines, -0 lines 0 comments Download
A chrome/browser/ui/unload_controller_web_contents_delegate.cc View 1 1 chunk +20 lines, -0 lines 0 comments Download
M chrome/browser/unload_browsertest.cc View 1 7 chunks +129 lines, -7 lines 0 comments Download

Messages

Total messages: 68 (43 generated)
zmin
Hi Scott, Can you review this CL please? Thanks, Owen
3 years, 10 months ago (2017-02-09 15:52:14 UTC) #6
sky
Why don't we skip the unload handlers entirely in this case? I'm specifically suggesting the ...
3 years, 10 months ago (2017-02-09 20:37:51 UTC) #7
zmin
On 2017/02/09 20:37:51, sky wrote: > Why don't we skip the unload handlers entirely in ...
3 years, 10 months ago (2017-02-10 00:58:59 UTC) #8
zmin
Code updated. On 2017/02/10 00:58:59, zmin wrote: > On 2017/02/09 20:37:51, sky wrote: > > ...
3 years, 10 months ago (2017-02-10 23:23:29 UTC) #11
sky
Please add test coverage of this too. https://codereview.chromium.org/2681203002/diff/20001/chrome/browser/ui/browser.h File chrome/browser/ui/browser.h (right): https://codereview.chromium.org/2681203002/diff/20001/chrome/browser/ui/browser.h#newcode328 chrome/browser/ui/browser.h:328: // ResetBeforeUnloadHandlers() ...
3 years, 10 months ago (2017-02-13 16:55:51 UTC) #14
zmin
On 2017/02/13 16:55:51, sky wrote: > Please add test coverage of this too. Which part ...
3 years, 10 months ago (2017-02-13 20:57:29 UTC) #21
sky
On 2017/02/13 20:57:29, zmin wrote: > On 2017/02/13 16:55:51, sky wrote: > > Please add ...
3 years, 10 months ago (2017-02-13 23:12:35 UTC) #24
sky
Minor comment on new wording. https://codereview.chromium.org/2681203002/diff/80001/chrome/browser/ui/browser.h File chrome/browser/ui/browser.h (right): https://codereview.chromium.org/2681203002/diff/80001/chrome/browser/ui/browser.h#newcode328 chrome/browser/ui/browser.h:328: // and window closing ...
3 years, 10 months ago (2017-02-13 23:12:54 UTC) #25
Charlie Reis
Sorry I haven't had time to review this yet-- I'm just returning from vacation. The ...
3 years, 10 months ago (2017-02-14 00:52:51 UTC) #27
zmin
On 2017/02/13 23:12:35, sky wrote: > On 2017/02/13 20:57:29, zmin wrote: > > On 2017/02/13 ...
3 years, 10 months ago (2017-02-14 02:23:39 UTC) #30
zmin
On 2017/02/14 00:52:51, Charlie Reis wrote: > Sorry I haven't had time to review this ...
3 years, 10 months ago (2017-02-14 03:10:09 UTC) #31
sky
Thanks for updating the code! Given Charlie's concerns I'm going to hold off on this ...
3 years, 10 months ago (2017-02-14 04:21:26 UTC) #34
Charlie Reis
On 2017/02/14 04:21:26, sky wrote: > Thanks for updating the code! > > Given Charlie's ...
3 years, 10 months ago (2017-02-15 21:59:16 UTC) #35
Charlie Reis
Thanks for addressing my concerns on the design doc. The general approach here LGTM for ...
3 years, 9 months ago (2017-02-27 21:47:52 UTC) #37
zmin
https://codereview.chromium.org/2681203002/diff/100001/chrome/browser/ui/browser.h File chrome/browser/ui/browser.h (right): https://codereview.chromium.org/2681203002/diff/100001/chrome/browser/ui/browser.h#newcode325 chrome/browser/ui/browser.h:325: // return false. If |skip_before_unload_event| is true, all beforeunload ...
3 years, 9 months ago (2017-03-06 23:58:08 UTC) #39
zmin
Hi sky, Can you take a look this CL again? Thanks, Owen
3 years, 9 months ago (2017-03-13 20:42:00 UTC) #47
sky
https://codereview.chromium.org/2681203002/diff/140001/chrome/browser/lifetime/browser_close_manager.cc File chrome/browser/lifetime/browser_close_manager.cc (right): https://codereview.chromium.org/2681203002/diff/140001/chrome/browser/lifetime/browser_close_manager.cc#newcode64 chrome/browser/lifetime/browser_close_manager.cc:64: for (auto* browser : *BrowserList::GetInstance()) { no {} https://codereview.chromium.org/2681203002/diff/140001/chrome/browser/ui/fast_unload_controller.cc ...
3 years, 9 months ago (2017-03-14 00:04:05 UTC) #48
Charlie Reis
(Thanks-- just a few other minor grammar nits to clarify it.) https://codereview.chromium.org/2681203002/diff/140001/chrome/browser/ui/browser.h File chrome/browser/ui/browser.h (right): ...
3 years, 9 months ago (2017-03-14 00:06:30 UTC) #49
zmin
https://codereview.chromium.org/2681203002/diff/140001/chrome/browser/lifetime/browser_close_manager.cc File chrome/browser/lifetime/browser_close_manager.cc (right): https://codereview.chromium.org/2681203002/diff/140001/chrome/browser/lifetime/browser_close_manager.cc#newcode64 chrome/browser/lifetime/browser_close_manager.cc:64: for (auto* browser : *BrowserList::GetInstance()) { On 2017/03/14 00:04:05, ...
3 years, 9 months ago (2017-03-14 17:46:47 UTC) #52
sky
https://codereview.chromium.org/2681203002/diff/140001/chrome/browser/ui/unload_controller.cc File chrome/browser/ui/unload_controller.cc (right): https://codereview.chromium.org/2681203002/diff/140001/chrome/browser/ui/unload_controller.cc#newcode320 chrome/browser/ui/unload_controller.cc:320: (*it)->SetDelegate(web_contents_delegate_.get()); On 2017/03/14 17:46:47, zmin wrote: > On 2017/03/14 ...
3 years, 9 months ago (2017-03-14 20:26:34 UTC) #55
Charlie Reis
https://codereview.chromium.org/2681203002/diff/140001/chrome/browser/ui/unload_controller.cc File chrome/browser/ui/unload_controller.cc (right): https://codereview.chromium.org/2681203002/diff/140001/chrome/browser/ui/unload_controller.cc#newcode320 chrome/browser/ui/unload_controller.cc:320: (*it)->SetDelegate(web_contents_delegate_.get()); On 2017/03/14 20:26:34, sky wrote: > On 2017/03/14 ...
3 years, 9 months ago (2017-03-14 23:21:44 UTC) #56
zmin
On 2017/03/14 23:21:44, Charlie Reis (slow) wrote: > https://codereview.chromium.org/2681203002/diff/140001/chrome/browser/ui/unload_controller.cc > File chrome/browser/ui/unload_controller.cc (right): > > ...
3 years, 9 months ago (2017-03-15 19:32:10 UTC) #59
sky
LGTM - not sure if anyone owns fastunloadcontroller
3 years, 9 months ago (2017-03-15 19:49:42 UTC) #60
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2681203002/180001
3 years, 9 months ago (2017-03-15 20:59:02 UTC) #65
commit-bot: I haz the power
3 years, 9 months ago (2017-03-15 21:06:36 UTC) #68
Message was sent while issue was closed.
Committed patchset #8 (id:180001) as
https://chromium.googlesource.com/chromium/src/+/9ea988f681de3e681c720e6046ce...

Powered by Google App Engine
This is Rietveld 408576698