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

Issue 16092009: Make sure OneClickSigninSyncStarter detects Browser object being closed (Closed)

Created:
7 years, 6 months ago by fdoray
Modified:
7 years, 6 months ago
CC:
chromium-reviews, Raghu Simha, haitaol1, akalin, tim (not reviewing)
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Visibility:
Public.

Description

Make sure OneClickSigninSyncStarter detects Browser object being closed Before this fix, OneClickSigninSyncStarter didn't detect when the Browser object it points to was closed. It could then cause a crash by making calls on the destroyed Browser object. OneClickSigninSyncStarter now observes the browser list to detect when the Browser it points to is closed. BUG=235439 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=204021

Patch Set 1 #

Total comments: 3

Patch Set 2 : Added missing OVERRIDE macro #

Total comments: 1

Patch Set 3 : Patch before commit #

Patch Set 4 : Patch before 2nd commit #

Total comments: 3
Unified diffs Side-by-side diffs Delta from patch set Stats (+23 lines, -7 lines) Patch
M chrome/browser/ui/sync/one_click_signin_sync_starter.h View 1 3 chunks +6 lines, -1 line 0 comments Download
M chrome/browser/ui/sync/one_click_signin_sync_starter.cc View 1 2 5 chunks +17 lines, -6 lines 3 comments Download

Messages

Total messages: 11 (0 generated)
fdoray
https://codereview.chromium.org/16092009/diff/1/chrome/browser/ui/sync/one_click_signin_sync_starter.cc File chrome/browser/ui/sync/one_click_signin_sync_starter.cc (right): https://codereview.chromium.org/16092009/diff/1/chrome/browser/ui/sync/one_click_signin_sync_starter.cc#newcode254 chrome/browser/ui/sync/one_click_signin_sync_starter.cc:254: if (confirmation_required_ == CONFIRM_UNTRUSTED_SIGNIN) { The only unit test ...
7 years, 6 months ago (2013-05-30 16:40:46 UTC) #1
Roger Tawa OOO till Jul 10th
lgtm https://codereview.chromium.org/16092009/diff/1/chrome/browser/ui/sync/one_click_signin_sync_starter.cc File chrome/browser/ui/sync/one_click_signin_sync_starter.cc (right): https://codereview.chromium.org/16092009/diff/1/chrome/browser/ui/sync/one_click_signin_sync_starter.cc#newcode254 chrome/browser/ui/sync/one_click_signin_sync_starter.cc:254: if (confirmation_required_ == CONFIRM_UNTRUSTED_SIGNIN) { On 2013/05/30 16:40:46, ...
7 years, 6 months ago (2013-05-30 18:14:49 UTC) #2
noms (inactive)
lgtm
7 years, 6 months ago (2013-05-31 17:26:13 UTC) #3
bcwhite
lgtm https://codereview.chromium.org/16092009/diff/6001/chrome/browser/ui/sync/one_click_signin_sync_starter.h File chrome/browser/ui/sync/one_click_signin_sync_starter.h (right): https://codereview.chromium.org/16092009/diff/6001/chrome/browser/ui/sync/one_click_signin_sync_starter.h#newcode69 chrome/browser/ui/sync/one_click_signin_sync_starter.h:69: // chrome::BrowserListObserver override. Just // BrowserListObserver:
7 years, 6 months ago (2013-06-03 14:06:23 UTC) #4
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/fdoray@chromium.org/16092009/12001
7 years, 6 months ago (2013-06-03 18:08:11 UTC) #5
commit-bot: I haz the power
The commit queue went berserk retrying too often for a seemingly flaky test on builder ...
7 years, 6 months ago (2013-06-04 09:36:04 UTC) #6
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/fdoray@chromium.org/16092009/30001
7 years, 6 months ago (2013-06-04 13:44:37 UTC) #7
commit-bot: I haz the power
Change committed as 204021
7 years, 6 months ago (2013-06-04 20:02:33 UTC) #8
Andrew T Wilson (Slow)
https://codereview.chromium.org/16092009/diff/30001/chrome/browser/ui/sync/one_click_signin_sync_starter.cc File chrome/browser/ui/sync/one_click_signin_sync_starter.cc (right): https://codereview.chromium.org/16092009/diff/30001/chrome/browser/ui/sync/one_click_signin_sync_starter.cc#newcode377 chrome/browser/ui/sync/one_click_signin_sync_starter.cc:377: chrome::AddBlankTabAt(browser_, -1, true); Why is this necessary? This code ...
7 years, 6 months ago (2013-06-05 08:43:51 UTC) #9
(NOT FOR CODE REVIEWS)
https://codereview.chromium.org/16092009/diff/30001/chrome/browser/ui/sync/one_click_signin_sync_starter.cc File chrome/browser/ui/sync/one_click_signin_sync_starter.cc (right): https://codereview.chromium.org/16092009/diff/30001/chrome/browser/ui/sync/one_click_signin_sync_starter.cc#newcode377 chrome/browser/ui/sync/one_click_signin_sync_starter.cc:377: chrome::AddBlankTabAt(browser_, -1, true); On 2013/06/05 08:43:51, Andrew T Wilson ...
7 years, 6 months ago (2013-06-05 14:11:34 UTC) #10
fdoray
7 years, 6 months ago (2013-06-05 15:09:03 UTC) #11
Message was sent while issue was closed.
https://codereview.chromium.org/16092009/diff/30001/chrome/browser/ui/sync/on...
File chrome/browser/ui/sync/one_click_signin_sync_starter.cc (right):

https://codereview.chromium.org/16092009/diff/30001/chrome/browser/ui/sync/on...
chrome/browser/ui/sync/one_click_signin_sync_starter.cc:377:
chrome::AddBlankTabAt(browser_, -1, true);
On 2013/06/05 14:11:34, Roger Tawa (Google) wrote:
> On 2013/06/05 08:43:51, Andrew T Wilson wrote:
> > Why is this necessary? This code was working properly before in the case
where
> > we create a new profile.
> 
> Maybe something changed since the time you looked at this?  Francois showed me
> that without this line, he would see a new window with only the "New tab"
button
> shown, no actual tab.

When you create a new profile as part of the sign in process, a new browser with
a new tab page is created before EnsureBrowser is called.
chrome::FindLastActiveWithProfile returns this browser and the line I added is
not executed. That's why the code seemed to work before. As Roger said, if I
remove the call to chrome::AddBlankTabAt, you get a window with no tab when the
"if" block is actually executed.

Powered by Google App Engine
This is Rietveld 408576698