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

Unified Diff: google_apis/gaia/oauth2_token_service.h

Issue 57103002: Make OAuth2TokenService::Request class multi-login aware. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebased Created 7 years, 1 month 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 side-by-side diff with in-line comments
Download patch
Index: google_apis/gaia/oauth2_token_service.h
diff --git a/google_apis/gaia/oauth2_token_service.h b/google_apis/gaia/oauth2_token_service.h
index 52ea3ad4d2baba896bcae8849653f07053fb35b4..1745315abf452feaf134ce21c6c63bc3339cbb54 100644
--- a/google_apis/gaia/oauth2_token_service.h
+++ b/google_apis/gaia/oauth2_token_service.h
@@ -56,6 +56,7 @@ class OAuth2TokenService : public base::NonThreadSafe {
class Request {
public:
virtual ~Request();
+ virtual std::string GetAccountId() const = 0;
Andrew T Wilson (Slow) 2013/11/05 09:28:48 Why is this necessary? Nobody calls this, and it s
protected:
Request();
};
@@ -177,9 +178,12 @@ class OAuth2TokenService : public base::NonThreadSafe {
public Request {
public:
// |consumer| is required to outlive this.
- explicit RequestImpl(Consumer* consumer);
+ explicit RequestImpl(const std::string& account_id, Consumer* consumer);
virtual ~RequestImpl();
+ // Overridden from Request:
+ virtual std::string GetAccountId() const OVERRIDE;
+
// Informs |consumer_| that this request is completed.
void InformConsumer(const GoogleServiceAuthError& error,
const std::string& access_token,
@@ -187,6 +191,7 @@ class OAuth2TokenService : public base::NonThreadSafe {
private:
// |consumer_| to call back when this request completes.
+ const std::string account_id_;
Consumer* const consumer_;
};
@@ -230,7 +235,9 @@ class OAuth2TokenService : public base::NonThreadSafe {
// Creates a request implementation. Can be overriden by derived classes to
// provide additional control of token consumption. |consumer| will outlive
// the created request.
- virtual scoped_ptr<RequestImpl> CreateRequest(Consumer* consumer);
+ virtual scoped_ptr<RequestImpl> CreateRequest(
+ const std::string& account_id,
+ Consumer* consumer);
// Fetches an OAuth token for the specified client/scopes. Virtual so it can
// be overridden for tests and for platform-specific behavior on Android.
« no previous file with comments | « chrome/browser/signin/profile_oauth2_token_service_request.cc ('k') | google_apis/gaia/oauth2_token_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698