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

Side by Side Diff: chrome/browser/signin/profile_oauth2_token_service.h

Issue 22581003: Handling of multiple concurrent requests from different clients in OAuth2TokenService (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fixes for bustes tests Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/browser/signin/profile_oauth2_token_service.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CHROME_BROWSER_SIGNIN_PROFILE_OAUTH2_TOKEN_SERVICE_H_ 5 #ifndef CHROME_BROWSER_SIGNIN_PROFILE_OAUTH2_TOKEN_SERVICE_H_
6 #define CHROME_BROWSER_SIGNIN_PROFILE_OAUTH2_TOKEN_SERVICE_H_ 6 #define CHROME_BROWSER_SIGNIN_PROFILE_OAUTH2_TOKEN_SERVICE_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/gtest_prod_util.h" 10 #include "base/gtest_prod_util.h"
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
96 96
97 // Updates the internal cache of the result from the most-recently-completed 97 // Updates the internal cache of the result from the most-recently-completed
98 // auth request (used for reporting errors to the user). 98 // auth request (used for reporting errors to the user).
99 virtual void UpdateAuthError(const GoogleServiceAuthError& error) OVERRIDE; 99 virtual void UpdateAuthError(const GoogleServiceAuthError& error) OVERRIDE;
100 100
101 // Overridden to not cache tokens if the TokenService refresh token 101 // Overridden to not cache tokens if the TokenService refresh token
102 // changes while a token fetch is in-flight. If the user logs out and 102 // changes while a token fetch is in-flight. If the user logs out and
103 // logs back in with a different account, then any in-flight token 103 // logs back in with a different account, then any in-flight token
104 // fetches will be for the old account's refresh token. Therefore 104 // fetches will be for the old account's refresh token. Therefore
105 // when they come back, they shouldn't be cached. 105 // when they come back, they shouldn't be cached.
106 virtual void RegisterCacheEntry(const std::string& refresh_token, 106 virtual void RegisterCacheEntry(const std::string& client_id,
107 const std::string& refresh_token,
107 const ScopeSet& scopes, 108 const ScopeSet& scopes,
108 const std::string& access_token, 109 const std::string& access_token,
109 const base::Time& expiration_date) OVERRIDE; 110 const base::Time& expiration_date) OVERRIDE;
110 111
111 private: 112 private:
112 FRIEND_TEST_ALL_PREFIXES(ProfileOAuth2TokenServiceTest, 113 FRIEND_TEST_ALL_PREFIXES(ProfileOAuth2TokenServiceTest,
113 StaleRefreshTokensNotCached); 114 StaleRefreshTokensNotCached);
114 FRIEND_TEST_ALL_PREFIXES(ProfileOAuth2TokenServiceTest, 115 FRIEND_TEST_ALL_PREFIXES(ProfileOAuth2TokenServiceTest,
115 TokenServiceUpdateClearsCache); 116 TokenServiceUpdateClearsCache);
116 FRIEND_TEST_ALL_PREFIXES(ProfileOAuth2TokenServiceTest, 117 FRIEND_TEST_ALL_PREFIXES(ProfileOAuth2TokenServiceTest,
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
153 // The auth status from the most-recently-completed request. 154 // The auth status from the most-recently-completed request.
154 GoogleServiceAuthError last_auth_error_; 155 GoogleServiceAuthError last_auth_error_;
155 156
156 // Registrar for notifications from the TokenService. 157 // Registrar for notifications from the TokenService.
157 content::NotificationRegistrar registrar_; 158 content::NotificationRegistrar registrar_;
158 159
159 DISALLOW_COPY_AND_ASSIGN(ProfileOAuth2TokenService); 160 DISALLOW_COPY_AND_ASSIGN(ProfileOAuth2TokenService);
160 }; 161 };
161 162
162 #endif // CHROME_BROWSER_SIGNIN_PROFILE_OAUTH2_TOKEN_SERVICE_H_ 163 #endif // CHROME_BROWSER_SIGNIN_PROFILE_OAUTH2_TOKEN_SERVICE_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/signin/profile_oauth2_token_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698