diff options
author | mnissler@chromium.org <mnissler@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-02-26 14:57:27 +0000 |
---|---|---|
committer | mnissler@chromium.org <mnissler@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-02-26 14:57:27 +0000 |
commit | f974485ee536ac08c94a26d6b142178c9af159db (patch) | |
tree | b9d5a2271868838891666302ffffeed38785fea3 /google_apis/gaia/oauth2_token_service.cc | |
parent | 5caaf5c5d1ceee3833ff2cc02282dd5544d8a381 (diff) | |
download | chromium_src-f974485ee536ac08c94a26d6b142178c9af159db.zip chromium_src-f974485ee536ac08c94a26d6b142178c9af159db.tar.gz chromium_src-f974485ee536ac08c94a26d6b142178c9af159db.tar.bz2 |
Rewrite DeviceOAuth2TokenService.
The old code handled asynchronous system salt loading in the factory
code, which made the Service a PITA to use. This change rewrites
DeviceOauth2TokenService to fold all asynchronous operations into
regular OAuth2TokenService implementation behavior, which is already
set up with Observers and callbacks already. Also, this change
improves the code to only perform validation once, even if there are
multiple concurrent token requests.
BUG=chromium:269455
TEST=Existing unit tests.
TBR=rogerta@chromium.org
Review URL: https://codereview.chromium.org/159773003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@253453 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'google_apis/gaia/oauth2_token_service.cc')
-rw-r--r-- | google_apis/gaia/oauth2_token_service.cc | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/google_apis/gaia/oauth2_token_service.cc b/google_apis/gaia/oauth2_token_service.cc index d18befd..6f46cb6 100644 --- a/google_apis/gaia/oauth2_token_service.cc +++ b/google_apis/gaia/oauth2_token_service.cc @@ -469,7 +469,7 @@ OAuth2TokenService::StartRequestForClientWithContext( Consumer* consumer) { DCHECK(CalledOnValidThread()); - scoped_ptr<RequestImpl> request = CreateRequest(account_id, consumer); + scoped_ptr<RequestImpl> request(new RequestImpl(account_id, consumer)); FOR_EACH_OBSERVER(DiagnosticsObserver, diagnostics_observer_list_, OnAccessTokenRequested(account_id, consumer->id(), @@ -508,12 +508,6 @@ OAuth2TokenService::StartRequestForClientWithContext( return request.PassAs<Request>(); } -scoped_ptr<OAuth2TokenService::RequestImpl> OAuth2TokenService::CreateRequest( - const std::string& account_id, - Consumer* consumer) { - return scoped_ptr<RequestImpl>(new RequestImpl(account_id, consumer)); -} - void OAuth2TokenService::FetchOAuth2Token(RequestImpl* request, const std::string& account_id, net::URLRequestContextGetter* getter, |