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

Unified Diff: remoting/host/oauth_token_getter.h

Issue 294813002: Add auto-refresh support to OAuthTokenGetter (disabled for now). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | remoting/host/oauth_token_getter.cc » ('j') | remoting/host/oauth_token_getter.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/host/oauth_token_getter.h
diff --git a/remoting/host/oauth_token_getter.h b/remoting/host/oauth_token_getter.h
index 4b48a4e68c35cc342875eb63f79dee907cd36020..99a289ccecf5e6e080205246c4f7c63558a2e00c 100644
--- a/remoting/host/oauth_token_getter.h
+++ b/remoting/host/oauth_token_getter.h
@@ -10,6 +10,8 @@
#include "base/basictypes.h"
#include "base/callback.h"
#include "base/threading/non_thread_safe.h"
+#include "base/time/time.h"
+#include "base/timer/timer.h"
#include "google_apis/gaia/gaia_oauth_client.h"
namespace net {
@@ -56,9 +58,12 @@ class OAuthTokenGetter :
OAuthTokenGetter(
scoped_ptr<OAuthCredentials> oauth_credentials,
- scoped_refptr<net::URLRequestContextGetter> url_request_context_getter);
+ scoped_refptr<net::URLRequestContextGetter> url_request_context_getter,
+ bool auto_refresh);
Sergey Ulanov 2014/05/19 22:33:46 Why do we need both this flag and EnableAutoRefres
rmsousa 2014/05/19 22:46:53 I forgot to delete EnableAutoRefresh() from here (
virtual ~OAuthTokenGetter();
+ void EnableAutoRefresh(bool enabled);
+
// Call |on_access_token| with an access token, or the failure status.
void CallWithToken(const OAuthTokenGetter::TokenCallback& on_access_token);
@@ -84,8 +89,10 @@ class OAuthTokenGetter :
bool refreshing_oauth_token_;
std::string oauth_access_token_;
+ std::string verified_email_;
base::Time auth_token_expiry_time_;
std::queue<OAuthTokenGetter::TokenCallback> pending_callbacks_;
+ scoped_ptr<base::OneShotTimer<OAuthTokenGetter> > refresh_timer_;
DISALLOW_COPY_AND_ASSIGN(OAuthTokenGetter);
};
« no previous file with comments | « no previous file | remoting/host/oauth_token_getter.cc » ('j') | remoting/host/oauth_token_getter.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698