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

Issue 2582573002: Signin/OAuth: Create an AccessTokenFetcher helper class (Closed)

Created:
4 years ago by Marc Treib
Modified:
3 years, 10 months ago
CC:
chromium-reviews
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Signin/OAuth: Create an AccessTokenFetcher helper class Reliably obtaining an OAuth2 access token from OAuth2TokenService is surprisingly complicated, since there are many special cases to handle (e.g. auth currently in progress, or auth completed but refresh token not loaded yet, ...). Various classes implement some subset of these edge cases. This CL introduces a new helper class that encapsulates all this, and adds a first usage as an example (in SuggestionsService). Partial list of additional classes that can be made simpler and more robust by using the new helper: - NTPSnippetsFetcher - FamilyInfoFetcher - SafeSearchURLReporter - PermissionRequestCreatorApiary BUG=609084 Review-Url: https://codereview.chromium.org/2582573002 Cr-Commit-Position: refs/heads/master@{#446678} Committed: https://chromium.googlesource.com/chromium/src/+/4c8c6cfe37c424387e26278371125cccbd16d5f3

Patch Set 1 #

Patch Set 2 : Tests! #

Patch Set 3 : Use in SuggestionsService; fixes #

Patch Set 4 : AuthInProgress test #

Total comments: 32

Patch Set 5 : review #

Patch Set 6 : ChromeOS, try2 #

Patch Set 7 : ChromeOS, try3 #

Patch Set 8 : ChromeOS, for realz now #

Total comments: 3

Patch Set 9 : review2 #

Total comments: 8

Patch Set 10 : review3 #

Patch Set 11 : ChromeOS... #

Patch Set 12 : rebase #

Patch Set 13 : return AuthErrors #

Total comments: 20

Patch Set 14 : review4 #

Total comments: 2

Patch Set 15 : review5 #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+730 lines, -83 lines) Patch
M components/signin/core/browser/BUILD.gn View 1 2 3 4 5 6 7 8 9 10 11 3 chunks +4 lines, -0 lines 0 comments Download
A components/signin/core/browser/access_token_fetcher.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +85 lines, -0 lines 0 comments Download
A components/signin/core/browser/access_token_fetcher.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +169 lines, -0 lines 0 comments Download
A components/signin/core/browser/access_token_fetcher_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +390 lines, -0 lines 1 comment Download
M components/signin/core/browser/fake_signin_manager.h View 1 2 3 4 1 chunk +0 lines, -1 line 0 comments Download
M components/suggestions/suggestions_service_impl.h View 1 2 3 4 5 6 7 8 9 10 11 12 5 chunks +14 lines, -5 lines 0 comments Download
M components/suggestions/suggestions_service_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 12 3 chunks +29 lines, -60 lines 0 comments Download
M components/suggestions/suggestions_service_impl_unittest.cc View 1 2 8 chunks +39 lines, -17 lines 0 comments Download

Messages

Total messages: 67 (41 generated)
Marc Treib
Hi Roger! Could you take a first look and check: - Do you agree that ...
3 years, 11 months ago (2017-01-17 15:26:09 UTC) #18
Roger Tawa OOO till Jul 10th
Hi Marc, I'm no longer working on signin, so passing off review to new owner ...
3 years, 11 months ago (2017-01-17 17:19:10 UTC) #20
msarda
CC+ Anthony Hi Marc, I personally think the fetcher that you are proposing makes a ...
3 years, 11 months ago (2017-01-18 21:55:19 UTC) #22
Marc Treib
PTAL again! Jan, there's one specific question there for you. https://codereview.chromium.org/2582573002/diff/100001/components/signin/core/browser/access_token_fetcher.cc File components/signin/core/browser/access_token_fetcher.cc (right): https://codereview.chromium.org/2582573002/diff/100001/components/signin/core/browser/access_token_fetcher.cc#newcode47 ...
3 years, 11 months ago (2017-01-19 15:03:56 UTC) #26
jkrcal
https://codereview.chromium.org/2582573002/diff/100001/components/signin/core/browser/access_token_fetcher.cc File components/signin/core/browser/access_token_fetcher.cc (right): https://codereview.chromium.org/2582573002/diff/100001/components/signin/core/browser/access_token_fetcher.cc#newcode116 components/signin/core/browser/access_token_fetcher.cc:116: StartAccessTokenRequest(); On 2017/01/19 15:03:55, Marc Treib wrote: > On ...
3 years, 11 months ago (2017-01-19 15:48:45 UTC) #29
anthonyvd
Hi! I'm also at a conference so I might not be able to thoroughly review ...
3 years, 11 months ago (2017-01-19 20:32:03 UTC) #30
Marc Treib
On 2017/01/19 20:32:03, anthonyvd wrote: > Hi! I'm also at a conference so I might ...
3 years, 11 months ago (2017-01-20 09:28:07 UTC) #31
anthonyvd
Overall this looks like a great change to me, plus it adds more tests that ...
3 years, 11 months ago (2017-01-23 14:31:00 UTC) #32
Marc Treib
On 2017/01/23 14:31:00, anthonyvd wrote: > Overall this looks like a great change to me, ...
3 years, 11 months ago (2017-01-23 14:34:39 UTC) #33
msarda
I have actually done this review on Friday and forgot to push the publish button ...
3 years, 11 months ago (2017-01-23 17:08:09 UTC) #34
Marc Treib
PTAL again! Returning an error code is still TBD, but the rest should be addressed. ...
3 years, 11 months ago (2017-01-24 10:17:33 UTC) #35
msarda
https://codereview.chromium.org/2582573002/diff/100001/components/signin/core/browser/access_token_fetcher.cc File components/signin/core/browser/access_token_fetcher.cc (right): https://codereview.chromium.org/2582573002/diff/100001/components/signin/core/browser/access_token_fetcher.cc#newcode121 components/signin/core/browser/access_token_fetcher.cc:121: callback_.Run(std::string()); On 2017/01/24 10:17:32, Marc Treib wrote: > On ...
3 years, 11 months ago (2017-01-25 09:54:29 UTC) #36
Marc Treib
Thanks for the review! Comments addressed, now hopefully the only remaining thing is returning an ...
3 years, 11 months ago (2017-01-25 11:37:05 UTC) #37
Marc Treib
https://codereview.chromium.org/2582573002/diff/180001/components/signin/core/browser/access_token_fetcher.cc File components/signin/core/browser/access_token_fetcher.cc (right): https://codereview.chromium.org/2582573002/diff/180001/components/signin/core/browser/access_token_fetcher.cc#newcode45 components/signin/core/browser/access_token_fetcher.cc:45: WaitForRefreshToken(); On 2017/01/24 10:17:33, Marc Treib wrote: > On ...
3 years, 11 months ago (2017-01-25 14:35:43 UTC) #38
msarda
I have not really worked on sign-in on Chrome Android - I think Ganggui would ...
3 years, 11 months ago (2017-01-25 14:51:24 UTC) #40
gogerald1
On 2017/01/25 14:51:24, msarda wrote: > I have not really worked on sign-in on Chrome ...
3 years, 11 months ago (2017-01-25 15:25:14 UTC) #41
Marc Treib
On 2017/01/25 15:25:14, gogerald1 wrote: > On 2017/01/25 14:51:24, msarda wrote: > > I have ...
3 years, 11 months ago (2017-01-25 15:29:30 UTC) #42
Marc Treib
msarda@, PTAL again - I've now added the error code to the callback, so the ...
3 years, 11 months ago (2017-01-26 12:09:36 UTC) #45
msarda
I have done a pass over the entire CL now. I still have a couple ...
3 years, 10 months ago (2017-01-27 10:38:58 UTC) #48
Marc Treib
Thanks! Comments addressed, PTAL again. https://codereview.chromium.org/2582573002/diff/280001/components/signin/core/browser/access_token_fetcher.cc File components/signin/core/browser/access_token_fetcher.cc (right): https://codereview.chromium.org/2582573002/diff/280001/components/signin/core/browser/access_token_fetcher.cc#newcode69 components/signin/core/browser/access_token_fetcher.cc:69: void AccessTokenFetcher::StartAccessTokenRequest() { On ...
3 years, 10 months ago (2017-01-27 11:16:56 UTC) #49
msarda
Roger / Anthony - Advice needed. Please take a quick look at the question below: ...
3 years, 10 months ago (2017-01-27 12:35:37 UTC) #54
Marc Treib
Thanks! PTAL again. I think the question to Roger/Anthony is really unrelated to this CL: ...
3 years, 10 months ago (2017-01-27 13:16:39 UTC) #55
Roger Tawa OOO till Jul 10th
On 2017/01/27 13:16:39, Marc Treib wrote: > Thanks! PTAL again. > > I think the ...
3 years, 10 months ago (2017-01-27 13:21:00 UTC) #56
msarda
LGTM. Thank you so much for doing this fetcher. I think it will simplify the ...
3 years, 10 months ago (2017-01-27 14:21:33 UTC) #57
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/2582573002/320001
3 years, 10 months ago (2017-01-27 16:07:12 UTC) #64
commit-bot: I haz the power
3 years, 10 months ago (2017-01-27 16:13:22 UTC) #67
Message was sent while issue was closed.
Committed patchset #15 (id:320001) as
https://chromium.googlesource.com/chromium/src/+/4c8c6cfe37c424387e2627837112...

Powered by Google App Engine
This is Rietveld 408576698