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

Issue 1380103004: Delay fetching account info until OnRefreshTokensLoaded(). (Closed)

Created:
5 years, 2 months ago by knn
Modified:
5 years, 1 month ago
CC:
chromium-reviews, rginda+watch_chromium.org, nyquist
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Delay fetching account info until OnRefreshTokensLoaded(). Always fire OnRefreshTokensLoaded after token service is ready. Previously this was only called if previously signed in. Also fix a missing BCKS dependency of the SigninManager on the AccountFetcherService. This causes a cyclic dependency among: AccountFetcherService - SigninManager - InvalidationProvider Solution is to inject InvalidationService before it is used. Added a Shutdown notification from InvalidationService to facilitate this. This will resolve 2 issues: 1> Android OS uses email id whereas Chrome uses the GAIA id to identify the account. This translation is only guaranteed to be available after OnRefreshTokensLoaded(), which is required before fetching anything. 2> In case of changes to the account, force refreshing before OnRefreshTokensLoaded() will result in stale values which are not updated. BUG=535211, 525207 Committed: https://crrev.com/3a5f21ae2dfb0b5fa385b1eb75c8e2a66f4fbdb5 Cr-Commit-Position: refs/heads/master@{#356820}

Patch Set 1 : Deprecated #

Total comments: 4

Patch Set 2 : Defensive checks #

Total comments: 1

Patch Set 3 : #

Total comments: 6

Patch Set 4 : Better #

Patch Set 5 : #

Total comments: 12

Patch Set 6 : nits #

Total comments: 5

Patch Set 7 : delay AFS #

Patch Set 8 : delay AFS fetch properly #

Total comments: 1

Patch Set 9 : always FireRefreshTokensLoaded #

Patch Set 10 : unregister Invalidation service correctly. #

Total comments: 6

Patch Set 11 : roger's comments #

Patch Set 12 : fix tests #

Patch Set 13 : extract separate method #

Patch Set 14 : fix iOs #

Unified diffs Side-by-side diffs Delta from patch set Stats (+134 lines, -117 lines) Patch
M chrome/browser/profiles/profile_manager.cc View 1 2 3 4 5 6 7 8 9 10 11 3 chunks +12 lines, -1 line 0 comments Download
M chrome/browser/signin/account_fetcher_service_factory.cc View 1 2 3 4 5 6 7 8 9 10 11 12 3 chunks +3 lines, -13 lines 0 comments Download
M chrome/browser/signin/fake_account_fetcher_service_builder.cc View 1 2 3 4 5 6 7 8 12 1 chunk +1 line, -2 lines 0 comments Download
M chrome/browser/signin/mutable_profile_oauth2_token_service_delegate.cc View 1 2 3 4 5 6 7 8 1 chunk +4 lines, -1 line 0 comments Download
M chrome/browser/signin/oauth2_token_service_delegate_android.cc View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +4 lines, -0 lines 0 comments Download
M chrome/browser/signin/signin_manager_factory.cc View 1 2 3 4 5 6 7 8 3 chunks +3 lines, -0 lines 0 comments Download
M chrome/browser/signin/signin_manager_unittest.cc View 1 2 3 4 5 6 1 chunk +1 line, -1 line 0 comments Download
M components/invalidation/impl/ticl_invalidation_service.cc View 1 2 3 4 5 6 7 8 9 1 chunk +2 lines, -0 lines 0 comments Download
M components/invalidation/public/invalidator_state.h View 1 2 3 4 5 6 7 8 9 1 chunk +3 lines, -0 lines 0 comments Download
M components/signin/core/browser/account_fetcher_service.h View 1 2 3 4 5 6 7 8 9 10 11 12 4 chunks +15 lines, -14 lines 0 comments Download
M components/signin/core/browser/account_fetcher_service.cc View 1 2 3 4 5 6 7 8 9 10 11 12 9 chunks +39 lines, -34 lines 0 comments Download
M components/signin/core/browser/account_tracker_service_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 20 chunks +35 lines, -37 lines 0 comments Download
M components/signin/core/browser/child_account_info_fetcher_impl.h View 1 2 3 4 5 6 7 8 9 1 chunk +1 line, -0 lines 0 comments Download
M components/signin/core/browser/child_account_info_fetcher_impl.cc View 1 2 3 4 5 6 7 8 9 3 chunks +9 lines, -3 lines 0 comments Download
M components/signin/core/browser/signin_manager.cc View 1 2 3 4 5 6 7 8 1 chunk +1 line, -1 line 0 comments Download
M ios/chrome/browser/signin/account_fetcher_service_factory.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 3 chunks +1 line, -10 lines 0 comments Download

Messages

Total messages: 84 (28 generated)
knn
PTAL.
5 years, 2 months ago (2015-10-01 13:47:24 UTC) #3
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1380103004/1 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1380103004/1
5 years, 2 months ago (2015-10-01 13:48:17 UTC) #5
Mike Lerman
This seems module nyquist's review. profiles LGTM https://codereview.chromium.org/1380103004/diff/1/chrome/browser/android/signin/account_tracker_service_android.cc File chrome/browser/android/signin/account_tracker_service_android.cc (right): https://codereview.chromium.org/1380103004/diff/1/chrome/browser/android/signin/account_tracker_service_android.cc#newcode42 chrome/browser/android/signin/account_tracker_service_android.cc:42: AccountFetcherServiceFactory::GetForProfile(profile) nit: ...
5 years, 2 months ago (2015-10-01 13:54:44 UTC) #6
Roger Tawa OOO till Jul 10th
+Anthony who owns AccountFetcherService https://codereview.chromium.org/1380103004/diff/1/chrome/browser/android/signin/account_tracker_service_android.cc File chrome/browser/android/signin/account_tracker_service_android.cc (right): https://codereview.chromium.org/1380103004/diff/1/chrome/browser/android/signin/account_tracker_service_android.cc#newcode45 chrome/browser/android/signin/account_tracker_service_android.cc:45: } I suspect this could ...
5 years, 2 months ago (2015-10-01 14:17:38 UTC) #8
commit-bot: I haz the power
Dry run: This issue passed the CQ dry run.
5 years, 2 months ago (2015-10-01 14:31:50 UTC) #10
anthonyvd
https://chromiumcodereview.appspot.com/1380103004/diff/1/chrome/browser/android/signin/account_tracker_service_android.cc File chrome/browser/android/signin/account_tracker_service_android.cc (right): https://chromiumcodereview.appspot.com/1380103004/diff/1/chrome/browser/android/signin/account_tracker_service_android.cc#newcode45 chrome/browser/android/signin/account_tracker_service_android.cc:45: } On 2015/10/01 14:17:38, Roger Tawa wrote: > I ...
5 years, 2 months ago (2015-10-01 14:33:20 UTC) #11
chromium-reviews
Don't know why flaky crash could happen, just offer you some information for reference. If ...
5 years, 2 months ago (2015-10-01 14:59:24 UTC) #12
knn
I have added the reason and also the stack trace for more context. As Anthony ...
5 years, 2 months ago (2015-10-01 16:25:23 UTC) #13
Roger Tawa OOO till Jul 10th
On 2015/10/01 16:25:23, knn wrote: > I have added the reason and also the stack ...
5 years, 2 months ago (2015-10-02 02:50:47 UTC) #14
knn
There seems to be other cases where this crash could occur so I was wondering ...
5 years, 2 months ago (2015-10-02 13:28:31 UTC) #15
knn
PTAL. Thanks! I have added defensive checks against the bad state. I added a AccountSeedingTracker ...
5 years, 2 months ago (2015-10-05 14:06:51 UTC) #16
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1380103004/20001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1380103004/20001
5 years, 2 months ago (2015-10-05 14:07:36 UTC) #19
knn
Removing Mike from review to avoid spamming him. https://codereview.chromium.org/1380103004/diff/20001/components/signin/core/browser/account_fetcher_service.h File components/signin/core/browser/account_fetcher_service.h (right): https://codereview.chromium.org/1380103004/diff/20001/components/signin/core/browser/account_fetcher_service.h#newcode73 components/signin/core/browser/account_fetcher_service.h:73: #if ...
5 years, 2 months ago (2015-10-05 14:11:45 UTC) #21
commit-bot: I haz the power
Dry run: Try jobs failed on following builders: ios_dbg_simulator_ninja on tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/ios_dbg_simulator_ninja/builds/77397) ios_rel_device_ninja on ...
5 years, 2 months ago (2015-10-05 14:12:50 UTC) #23
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1380103004/40001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1380103004/40001
5 years, 2 months ago (2015-10-05 14:24:28 UTC) #25
commit-bot: I haz the power
Dry run: Try jobs failed on following builders: linux_chromium_clobber_rel_ng on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_clobber_rel_ng/builds/78093)
5 years, 2 months ago (2015-10-05 14:32:30 UTC) #27
anthonyvd
https://chromiumcodereview.appspot.com/1380103004/diff/40001/chrome/browser/android/signin/account_tracker_service_android.cc File chrome/browser/android/signin/account_tracker_service_android.cc (right): https://chromiumcodereview.appspot.com/1380103004/diff/40001/chrome/browser/android/signin/account_tracker_service_android.cc#newcode38 chrome/browser/android/signin/account_tracker_service_android.cc:38: AccountFetcherServiceFactory::GetForProfile(profile)->OnAccountsSeeded(); The idea behind splitting the AFS into the ...
5 years, 2 months ago (2015-10-05 16:05:50 UTC) #28
knn
Thanks for taking a quick look, Anthony! https://chromiumcodereview.appspot.com/1380103004/diff/40001/chrome/browser/android/signin/account_tracker_service_android.cc File chrome/browser/android/signin/account_tracker_service_android.cc (right): https://chromiumcodereview.appspot.com/1380103004/diff/40001/chrome/browser/android/signin/account_tracker_service_android.cc#newcode38 chrome/browser/android/signin/account_tracker_service_android.cc:38: AccountFetcherServiceFactory::GetForProfile(profile)->OnAccountsSeeded(); On ...
5 years, 2 months ago (2015-10-05 16:35:55 UTC) #29
anthonyvd
https://chromiumcodereview.appspot.com/1380103004/diff/40001/chrome/browser/android/signin/account_tracker_service_android.cc File chrome/browser/android/signin/account_tracker_service_android.cc (right): https://chromiumcodereview.appspot.com/1380103004/diff/40001/chrome/browser/android/signin/account_tracker_service_android.cc#newcode38 chrome/browser/android/signin/account_tracker_service_android.cc:38: AccountFetcherServiceFactory::GetForProfile(profile)->OnAccountsSeeded(); On 2015/10/05 16:35:55, knn wrote: > On 2015/10/05 ...
5 years, 2 months ago (2015-10-05 20:45:21 UTC) #30
knn
Anthony, I think I have a better design now. Let me know if you still ...
5 years, 2 months ago (2015-10-06 14:11:37 UTC) #31
anthonyvd
lgtm % small nit, although I'm not an OWNER in signin so Roger can take ...
5 years, 2 months ago (2015-10-06 18:18:55 UTC) #32
Roger Tawa OOO till Jul 10th
Hi Khannan, See comments below. I don't fully understand the "other" cases of the crash. ...
5 years, 2 months ago (2015-10-13 12:40:56 UTC) #33
knn
Hi Roger, The 'other' cases of crashes are when the accounts in the device changes ...
5 years, 2 months ago (2015-10-13 13:15:42 UTC) #34
gogerald1
Hi Khannan, I left few comments there for your reference. Still don't see how it ...
5 years, 2 months ago (2015-10-13 16:34:53 UTC) #35
chromium-reviews
"accounts in the device changes at any point and the AFS tries to do something"-->AFS ...
5 years, 2 months ago (2015-10-13 16:43:14 UTC) #36
nyquist
this looks reasonable to me, but it'd be great if rogerta@ also could take a ...
5 years, 2 months ago (2015-10-15 19:33:45 UTC) #37
knn
Sorry about the lack of updates here. This bug is getting more and more difficult ...
5 years, 2 months ago (2015-10-16 13:30:52 UTC) #38
Roger Tawa OOO till Jul 10th
On 2015/10/16 13:30:52, knn wrote: > Sorry about the lack of updates here. > This ...
5 years, 2 months ago (2015-10-20 19:59:14 UTC) #39
knn
Thanks for explaining Roger! Agreed. Let us go with delaying the AFS since that will ...
5 years, 2 months ago (2015-10-21 07:35:42 UTC) #40
knn
Roger, PTAL. Thanks!
5 years, 2 months ago (2015-10-21 13:13:50 UTC) #44
Roger Tawa OOO till Jul 10th
Nice Khannan! I think we need to keep the EnableNetworkFetches() function and the call to ...
5 years, 2 months ago (2015-10-21 19:09:00 UTC) #45
knn
If I understand correctly what you mean is: EnableNetworkFetches() { ScheduleNextRefresh(); network_fetches_enabled_ = true; } ...
5 years, 2 months ago (2015-10-22 11:06:22 UTC) #46
knn
Roger, PTAL at the new patch which always fires OnRefreshTokenLoaded. :) I have removed the ...
5 years, 2 months ago (2015-10-23 09:50:43 UTC) #47
Roger Tawa OOO till Jul 10th
lgtm Please wait for another lgtm from Anthony, since the CL has changed a lot ...
5 years, 2 months ago (2015-10-23 12:42:12 UTC) #48
knn
Thanks for the review Roger! I'll wait for Anthony's review but also adding back Mike ...
5 years, 2 months ago (2015-10-23 13:32:53 UTC) #50
knn
pavely@chromium.org: Please review changes in components/invalidation/* I have added a new Invalidation state to notify ...
5 years, 2 months ago (2015-10-23 13:39:56 UTC) #52
anthonyvd
lgtm I think this simplifies the AFS a lot as well. Thanks :)
5 years, 2 months ago (2015-10-23 14:22:55 UTC) #54
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1380103004/200001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1380103004/200001
5 years, 1 month ago (2015-10-26 13:54:10 UTC) #56
commit-bot: I haz the power
Dry run: Try jobs failed on following builders: linux_chromium_chromeos_rel_ng on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_chromeos_rel_ng/builds/120264)
5 years, 1 month ago (2015-10-26 14:17:38 UTC) #58
knn
On 2015/10/23 13:39:56, knn wrote: > mailto:pavely@chromium.org: Please review changes in > components/invalidation/* > I ...
5 years, 1 month ago (2015-10-27 19:56:12 UTC) #59
pavely
lgtm
5 years, 1 month ago (2015-10-28 02:09:00 UTC) #60
knn
Hi Roger, Anthony, I had to make some more changes to the AFS relating to ...
5 years, 1 month ago (2015-10-28 16:51:00 UTC) #61
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1380103004/220001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1380103004/220001
5 years, 1 month ago (2015-10-28 16:52:02 UTC) #63
Roger Tawa OOO till Jul 10th
Thanks for the heads up Khannan. Actually, I would like a change to this new ...
5 years, 1 month ago (2015-10-28 18:05:51 UTC) #64
commit-bot: I haz the power
Dry run: This issue passed the CQ dry run.
5 years, 1 month ago (2015-10-28 18:21:45 UTC) #66
knn
Absolutely! Done. PTAL. Thanks!
5 years, 1 month ago (2015-10-28 20:44:44 UTC) #67
Roger Tawa OOO till Jul 10th
lgtm Thanks Khannan.
5 years, 1 month ago (2015-10-28 21:05:57 UTC) #68
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1380103004/240001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1380103004/240001
5 years, 1 month ago (2015-10-29 06:43:07 UTC) #71
commit-bot: I haz the power
Try jobs failed on following builders: ios_dbg_simulator_ninja on tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/ios_dbg_simulator_ninja/builds/87456)
5 years, 1 month ago (2015-10-29 06:59:28 UTC) #73
knn
Mihai: Please review changes in ios/chrome/browser/signin/account_fetcher_service_factory.cc invalidation_service is no longer passed at Initialize but is ...
5 years, 1 month ago (2015-10-29 09:32:10 UTC) #76
Bernhard Bauer
On 2015/10/28 16:51:00, knn wrote: > Hi Roger, Anthony, > > I had to make ...
5 years, 1 month ago (2015-10-29 09:42:28 UTC) #77
knn
On 2015/10/29 09:42:28, Bernhard Bauer wrote: > On 2015/10/28 16:51:00, knn wrote: > > Hi ...
5 years, 1 month ago (2015-10-29 09:59:41 UTC) #78
msarda
iOS changes LGTM.
5 years, 1 month ago (2015-10-29 10:57:55 UTC) #79
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1380103004/280001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1380103004/280001
5 years, 1 month ago (2015-10-29 11:23:10 UTC) #82
commit-bot: I haz the power
Committed patchset #14 (id:280001)
5 years, 1 month ago (2015-10-29 12:14:20 UTC) #83
commit-bot: I haz the power
5 years, 1 month ago (2015-10-29 12:15:09 UTC) #84
Message was sent while issue was closed.
Patchset 14 (id:??) landed as
https://crrev.com/3a5f21ae2dfb0b5fa385b1eb75c8e2a66f4fbdb5
Cr-Commit-Position: refs/heads/master@{#356820}

Powered by Google App Engine
This is Rietveld 408576698