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

Issue 12380006: Build a new TokenCacheService so I can stop using TokenService for something it wasn't designed for. (Closed)

Created:
7 years, 9 months ago by Pete Williamson
Modified:
7 years, 9 months ago
CC:
chromium-reviews, akalin, Raghu Simha, sail+watch_chromium.org, Aaron Boodman, chromium-apps-reviews_chromium.org, haitaol1, tim (not reviewing)
Base URL:
http://git.chromium.org/chromium/src.git@master
Visibility:
Public.

Description

Build a new TokenCacheService so I can stop using TokenService. When building code to cache the Obfuscated Gaia Id that we receive from the server, we had used the TokenService to cache it. However, the Token service wasn't designed to cache arbitrary tokens, it was designed to fetch tokens, and cached the fetched token as a side effect. This patch delivers a new TokenCache service that does nothing more than cache tokens on a per-profile basis. The Cache will be cleared out when the user signs out and when chromium exits. This patch also removes the code I added to TokenService to allow manually adding a token, since we no longer need that code. BUG=177125 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=188130

Patch Set 1 #

Total comments: 55

Patch Set 2 : Token Cache - CR changes per DCheng and ATWilson #

Total comments: 30

Patch Set 3 : Token Cache - feedback per DCheng #

Patch Set 4 : Token #

Patch Set 5 : Token Cache Service - update namespace #

Total comments: 36

Patch Set 6 : Token Cache Service - more CR fixes per DCheng #

Total comments: 19

Patch Set 7 : Token Cache Service - CR fixes per DCheng and ATWilson #

Total comments: 14

Patch Set 8 : Token Cache Service - fix nits #

Total comments: 2

Patch Set 9 : Token Cache Service - fix gypi #

Total comments: 8

Patch Set 10 : Token Cache Service - post LGTM nits and merging with master #

Unified diffs Side-by-side diffs Delta from patch set Stats (+349 lines, -14 lines) Patch
M chrome/browser/extensions/api/push_messaging/push_messaging_api.cc View 1 2 3 4 5 6 7 8 9 4 chunks +14 lines, -6 lines 0 comments Download
A chrome/browser/extensions/token_cache/token_cache_service.h View 1 2 3 4 5 6 7 8 9 1 chunk +69 lines, -0 lines 0 comments Download
A chrome/browser/extensions/token_cache/token_cache_service.cc View 1 2 3 4 5 6 7 1 chunk +78 lines, -0 lines 0 comments Download
A chrome/browser/extensions/token_cache/token_cache_service_factory.h View 1 2 3 4 5 6 1 chunk +34 lines, -0 lines 0 comments Download
A chrome/browser/extensions/token_cache/token_cache_service_factory.cc View 1 2 3 4 5 6 7 1 chunk +34 lines, -0 lines 0 comments Download
A chrome/browser/extensions/token_cache/token_cache_service_unittest.cc View 1 2 3 4 5 6 7 1 chunk +113 lines, -0 lines 0 comments Download
M chrome/browser/profiles/profile_dependency_manager.cc View 1 2 3 4 5 6 7 8 9 2 chunks +2 lines, -0 lines 0 comments Download
M chrome/browser/signin/token_service.cc View 1 2 3 4 5 6 7 8 9 2 chunks +0 lines, -8 lines 0 comments Download
M chrome/chrome_browser.gypi View 1 2 3 4 5 6 7 8 9 1 chunk +4 lines, -0 lines 0 comments Download
M chrome/chrome_tests_unit.gypi View 1 2 3 4 5 6 7 8 9 1 chunk +1 line, -0 lines 0 comments Download

Messages

Total messages: 30 (0 generated)
Pete Williamson
Which reviewers should review what: sky@: OWNERS review of the new directory I'm adding to ...
7 years, 9 months ago (2013-02-28 17:55:58 UTC) #1
dcheng
https://codereview.chromium.org/12380006/diff/1/chrome/browser/extensions/api/push_messaging/push_messaging_api.cc File chrome/browser/extensions/api/push_messaging/push_messaging_api.cc (right): https://codereview.chromium.org/12380006/diff/1/chrome/browser/extensions/api/push_messaging/push_messaging_api.cc#newcode22 chrome/browser/extensions/api/push_messaging/push_messaging_api.cc:22: #include "chrome/browser/signin/token_service_factory.h" Seems like we don't need these includes ...
7 years, 9 months ago (2013-02-28 19:18:03 UTC) #2
Andrew T Wilson (Slow)
I'd either put this service under extensions/api (since you're the only user) or, if you ...
7 years, 9 months ago (2013-03-01 17:50:54 UTC) #3
Pete Williamson
Addressed a round of CR feedback, ATWilson and DCheng, please take another look https://codereview.chromium.org/12380006/diff/1/chrome/browser/extensions/api/push_messaging/push_messaging_api.cc File ...
7 years, 9 months ago (2013-03-04 18:32:53 UTC) #4
dcheng
https://codereview.chromium.org/12380006/diff/1/chrome/browser/token_cache/token_cache.cc File chrome/browser/token_cache/token_cache.cc (right): https://codereview.chromium.org/12380006/diff/1/chrome/browser/token_cache/token_cache.cc#newcode39 chrome/browser/token_cache/token_cache.cc:39: } else if (expiration_timeout < 0) { On 2013/03/04 ...
7 years, 9 months ago (2013-03-04 22:40:59 UTC) #5
Pete Williamson
This should address all outstanding feedback from DCheng. https://codereview.chromium.org/12380006/diff/1/chrome/browser/token_cache/token_cache.cc File chrome/browser/token_cache/token_cache.cc (right): https://codereview.chromium.org/12380006/diff/1/chrome/browser/token_cache/token_cache.cc#newcode39 chrome/browser/token_cache/token_cache.cc:39: } ...
7 years, 9 months ago (2013-03-05 19:42:25 UTC) #6
dcheng
https://codereview.chromium.org/12380006/diff/18001/chrome/browser/extensions/api/push_messaging/push_messaging_api.cc File chrome/browser/extensions/api/push_messaging/push_messaging_api.cc (right): https://codereview.chromium.org/12380006/diff/18001/chrome/browser/extensions/api/push_messaging/push_messaging_api.cc#newcode182 chrome/browser/extensions/api/push_messaging/push_messaging_api.cc:182: int timeoutDays = GaiaConstants::kObfuscatedGaiaIdTimeoutInDays; Naming is incorrect. Also, I'd ...
7 years, 9 months ago (2013-03-05 22:38:44 UTC) #7
Pete Williamson
Addressing more comments from DCheng https://codereview.chromium.org/12380006/diff/18001/chrome/browser/extensions/api/push_messaging/push_messaging_api.cc File chrome/browser/extensions/api/push_messaging/push_messaging_api.cc (right): https://codereview.chromium.org/12380006/diff/18001/chrome/browser/extensions/api/push_messaging/push_messaging_api.cc#newcode182 chrome/browser/extensions/api/push_messaging/push_messaging_api.cc:182: int timeoutDays = GaiaConstants::kObfuscatedGaiaIdTimeoutInDays; ...
7 years, 9 months ago (2013-03-06 00:09:39 UTC) #8
dcheng
https://codereview.chromium.org/12380006/diff/18001/chrome/browser/extensions/token_cache/token_cache.cc File chrome/browser/extensions/token_cache/token_cache.cc (right): https://codereview.chromium.org/12380006/diff/18001/chrome/browser/extensions/token_cache/token_cache.cc#newcode45 chrome/browser/extensions/token_cache/token_cache.cc:45: std::map<std::string, TokenCacheData>::iterator it = FindMatch(token_name); On 2013/03/06 00:09:40, Pete ...
7 years, 9 months ago (2013-03-06 00:26:34 UTC) #9
Pete Williamson
Answers for DCheng (the changes are minor, so I will batch them with the next ...
7 years, 9 months ago (2013-03-06 00:50:05 UTC) #10
dcheng
https://codereview.chromium.org/12380006/diff/18001/chrome/browser/extensions/token_cache/token_cache.cc File chrome/browser/extensions/token_cache/token_cache.cc (right): https://codereview.chromium.org/12380006/diff/18001/chrome/browser/extensions/token_cache/token_cache.cc#newcode45 chrome/browser/extensions/token_cache/token_cache.cc:45: std::map<std::string, TokenCacheData>::iterator it = FindMatch(token_name); On 2013/03/06 00:50:05, Pete ...
7 years, 9 months ago (2013-03-06 02:30:25 UTC) #11
Andrew T Wilson (Slow)
Mostly looks good, although I think both Daniel and I are somewhat uncomfortable with FindMatch(). ...
7 years, 9 months ago (2013-03-06 16:55:27 UTC) #12
Pete Williamson
On 2013/03/06 02:30:25, dcheng wrote: > https://codereview.chromium.org/12380006/diff/18001/chrome/browser/extensions/token_cache/token_cache.cc > File chrome/browser/extensions/token_cache/token_cache.cc (right): > > https://codereview.chromium.org/12380006/diff/18001/chrome/browser/extensions/token_cache/token_cache.cc#newcode45 > ...
7 years, 9 months ago (2013-03-06 18:14:46 UTC) #13
Pete Williamson
Renamed files to match classes, other minor CR fixes per DCheng and ATWilson https://codereview.chromium.org/12380006/diff/26001/chrome/browser/extensions/token_cache/token_cache.cc File ...
7 years, 9 months ago (2013-03-06 19:04:31 UTC) #14
dcheng
LGTM with nits addressed. https://codereview.chromium.org/12380006/diff/41001/chrome/browser/extensions/token_cache/token_cache_service_factory.cc File chrome/browser/extensions/token_cache/token_cache_service_factory.cc (right): https://codereview.chromium.org/12380006/diff/41001/chrome/browser/extensions/token_cache/token_cache_service_factory.cc#newcode14 chrome/browser/extensions/token_cache/token_cache_service_factory.cc:14: return static_cast<extensions::TokenCacheService*>( Indent is weird. ...
7 years, 9 months ago (2013-03-06 19:53:52 UTC) #15
dcheng
Also, please remember to update the CL description before committing this. Remember that it ends ...
7 years, 9 months ago (2013-03-06 21:11:09 UTC) #16
Pete Williamson
All nits fixed (I'll include them with the next batch of actual code review changes ...
7 years, 9 months ago (2013-03-06 21:12:11 UTC) #17
Andrew T Wilson (Slow)
LGTM with a few nits. https://codereview.chromium.org/12380006/diff/41001/chrome/browser/extensions/token_cache/token_cache_service.cc File chrome/browser/extensions/token_cache/token_cache_service.cc (right): https://codereview.chromium.org/12380006/diff/41001/chrome/browser/extensions/token_cache/token_cache_service.cc#newcode74 chrome/browser/extensions/token_cache/token_cache_service.cc:74: if (type == chrome::NOTIFICATION_GOOGLE_SIGNED_OUT) ...
7 years, 9 months ago (2013-03-07 11:48:08 UTC) #18
Pete Williamson
ping sky@: OWNERS review of the new directory I'm adding to chrome/browser, and all its ...
7 years, 9 months ago (2013-03-07 20:02:46 UTC) #19
sky
On Thu, Mar 7, 2013 at 12:02 PM, <petewil@chromium.org> wrote: > ping sky@: OWNERS review ...
7 years, 9 months ago (2013-03-07 21:07:28 UTC) #20
sky
https://codereview.chromium.org/12380006/diff/47001/chrome/chrome_browser.gypi File chrome/chrome_browser.gypi (right): https://codereview.chromium.org/12380006/diff/47001/chrome/chrome_browser.gypi#newcode594 chrome/chrome_browser.gypi:594: 'browser/token_cache/token_cache_factory.h', I don't see this file in your patch ...
7 years, 9 months ago (2013-03-07 21:08:40 UTC) #21
Pete Williamson
Fix the gypi problem Sky noticed. https://codereview.chromium.org/12380006/diff/47001/chrome/chrome_browser.gypi File chrome/chrome_browser.gypi (right): https://codereview.chromium.org/12380006/diff/47001/chrome/chrome_browser.gypi#newcode594 chrome/chrome_browser.gypi:594: 'browser/token_cache/token_cache_factory.h', On 2013/03/07 ...
7 years, 9 months ago (2013-03-07 22:40:57 UTC) #22
sky
*.gypi LGTM
7 years, 9 months ago (2013-03-07 23:38:21 UTC) #23
Pete Williamson
+ASargent - Anthony, please do an OWNERS review of the new files in extensions/notifications/sync_notifier. DCheng ...
7 years, 9 months ago (2013-03-11 23:23:51 UTC) #24
asargent_no_longer_on_chrome
LGTM https://codereview.chromium.org/12380006/diff/52001/chrome/browser/extensions/token_cache/token_cache_service.h File chrome/browser/extensions/token_cache/token_cache_service.h (right): https://codereview.chromium.org/12380006/diff/52001/chrome/browser/extensions/token_cache/token_cache_service.h#newcode28 chrome/browser/extensions/token_cache/token_cache_service.h:28: // the instance of chrome shuts down. We ...
7 years, 9 months ago (2013-03-12 00:11:31 UTC) #25
Pete Williamson
Replies for ASargent (I'll upload the fixes with the next batch) https://codereview.chromium.org/12380006/diff/52001/chrome/browser/extensions/token_cache/token_cache_service.h File chrome/browser/extensions/token_cache/token_cache_service.h (right): ...
7 years, 9 months ago (2013-03-12 00:39:25 UTC) #26
Andrew T Wilson (Slow)
On 2013/03/12 00:11:31, Antony Sargent wrote: > LGTM > > https://codereview.chromium.org/12380006/diff/52001/chrome/browser/extensions/token_cache/token_cache_service.h > File chrome/browser/extensions/token_cache/token_cache_service.h (right): ...
7 years, 9 months ago (2013-03-12 08:58:11 UTC) #27
asargent_no_longer_on_chrome
Ok, good to hear - it sounds like what's in this CL is the right ...
7 years, 9 months ago (2013-03-12 17:36:45 UTC) #28
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/petewil@chromium.org/12380006/41002
7 years, 9 months ago (2013-03-13 18:48:32 UTC) #29
commit-bot: I haz the power
7 years, 9 months ago (2013-03-14 18:09:17 UTC) #30
Message was sent while issue was closed.
Change committed as 188130

Powered by Google App Engine
This is Rietveld 408576698