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

Side by Side Diff: google_apis/gaia/ubertoken_fetcher.h

Issue 1129463004: Let Ubertoken Fetch be primed with an access token. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 5 years, 7 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 GOOGLE_APIS_GAIA_UBERTOKEN_FETCHER_H_ 5 #ifndef GOOGLE_APIS_GAIA_UBERTOKEN_FETCHER_H_
6 #define GOOGLE_APIS_GAIA_UBERTOKEN_FETCHER_H_ 6 #define GOOGLE_APIS_GAIA_UBERTOKEN_FETCHER_H_
7 7
8 #include "base/memory/scoped_ptr.h" 8 #include "base/memory/scoped_ptr.h"
9 #include "base/timer/timer.h" 9 #include "base/timer/timer.h"
10 #include "google_apis/gaia/gaia_auth_consumer.h" 10 #include "google_apis/gaia/gaia_auth_consumer.h"
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 static const int kMaxRetries; 43 static const int kMaxRetries;
44 44
45 UbertokenFetcher(OAuth2TokenService* token_service, 45 UbertokenFetcher(OAuth2TokenService* token_service,
46 UbertokenConsumer* consumer, 46 UbertokenConsumer* consumer,
47 const std::string& source, 47 const std::string& source,
48 net::URLRequestContextGetter* request_context); 48 net::URLRequestContextGetter* request_context);
49 ~UbertokenFetcher() override; 49 ~UbertokenFetcher() override;
50 50
51 // Start fetching the token for |account_id|. 51 // Start fetching the token for |account_id|.
52 virtual void StartFetchingToken(const std::string& account_id); 52 virtual void StartFetchingToken(const std::string& account_id);
53 virtual void StartFetchingTokenWithAccessToken(const std::string& account_id,
54 const std::string& access_token);
53 55
54 // Overriden from GaiaAuthConsumer 56 // Overriden from GaiaAuthConsumer
55 void OnUberAuthTokenSuccess(const std::string& token) override; 57 void OnUberAuthTokenSuccess(const std::string& token) override;
56 void OnUberAuthTokenFailure(const GoogleServiceAuthError& error) override; 58 void OnUberAuthTokenFailure(const GoogleServiceAuthError& error) override;
57 59
58 // Overriden from OAuth2TokenService::Consumer: 60 // Overriden from OAuth2TokenService::Consumer:
59 void OnGetTokenSuccess(const OAuth2TokenService::Request* request, 61 void OnGetTokenSuccess(const OAuth2TokenService::Request* request,
60 const std::string& access_token, 62 const std::string& access_token,
61 const base::Time& expiration_time) override; 63 const base::Time& expiration_time) override;
62 void OnGetTokenFailure(const OAuth2TokenService::Request* request, 64 void OnGetTokenFailure(const OAuth2TokenService::Request* request,
(...skipping 15 matching lines...) Expand all
78 std::string account_id_; 80 std::string account_id_;
79 std::string access_token_; 81 std::string access_token_;
80 int retry_number_; 82 int retry_number_;
81 base::OneShotTimer<UbertokenFetcher> retry_timer_; 83 base::OneShotTimer<UbertokenFetcher> retry_timer_;
82 bool second_access_token_request_; 84 bool second_access_token_request_;
83 85
84 DISALLOW_COPY_AND_ASSIGN(UbertokenFetcher); 86 DISALLOW_COPY_AND_ASSIGN(UbertokenFetcher);
85 }; 87 };
86 88
87 #endif // GOOGLE_APIS_GAIA_UBERTOKEN_FETCHER_H_ 89 #endif // GOOGLE_APIS_GAIA_UBERTOKEN_FETCHER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698