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

Unified Diff: sync/engine/net/server_connection_manager.h

Issue 15421011: Use OAuth2 token for sync (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 7 years, 6 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 | « jingle/notifier/base/notifier_options_util.cc ('k') | sync/engine/net/server_connection_manager.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sync/engine/net/server_connection_manager.h
diff --git a/sync/engine/net/server_connection_manager.h b/sync/engine/net/server_connection_manager.h
index f46ee89fc39b1ca943dbb3931e6d854f7c643dad..3bd533e78fdd07d555e54d296e9b70465fd5bbf6 100644
--- a/sync/engine/net/server_connection_manager.h
+++ b/sync/engine/net/server_connection_manager.h
@@ -164,10 +164,12 @@ class SYNC_EXPORT_PRIVATE ServerConnectionManager {
void GetServerParams(std::string* server,
int* server_port,
- bool* use_ssl) const {
+ bool* use_ssl,
+ bool* use_oauth2_token) const {
server->assign(scm_->sync_server_);
*server_port = scm_->sync_server_port_;
*use_ssl = scm_->use_ssl_;
+ *use_oauth2_token = scm_->use_oauth2_token_;
}
std::string buffer_;
@@ -180,7 +182,8 @@ class SYNC_EXPORT_PRIVATE ServerConnectionManager {
ServerConnectionManager(const std::string& server,
int port,
- bool use_ssl);
+ bool use_ssl,
+ bool use_oauth2_token);
virtual ~ServerConnectionManager();
@@ -224,11 +227,8 @@ class SYNC_EXPORT_PRIVATE ServerConnectionManager {
client_id_.assign(client_id);
}
- // Sets a new auth token and time. |auth_token_time| is an optional parameter
- // that contains the date the auth token was fetched/refreshed, and is used
- // for histogramms/logging only.
- bool SetAuthToken(const std::string& auth_token,
- const base::Time& auth_token_time);
+ // Sets a new auth token and time.
+ bool SetAuthToken(const std::string& auth_token);
// Our out-of-band invalidations channel can encounter auth errors,
// and when it does so it tells us via this method to prevent making more
@@ -288,16 +288,17 @@ class SYNC_EXPORT_PRIVATE ServerConnectionManager {
// Indicates whether or not requests should be made using HTTPS.
bool use_ssl_;
+ // Indicates if token should be handled as OAuth2 token. Connection should set
+ // auth header appropriately.
+ // TODO(pavely): Remove once sync on android switches to oauth2 tokens.
+ bool use_oauth2_token_;
+
// The paths we post to.
std::string proto_sync_path_;
// The auth token to use in authenticated requests.
std::string auth_token_;
- // The time at which this auth token was last created/refreshed.
- // Used for histogramming.
- base::Time auth_token_time_;
-
// The previous auth token that is invalid now.
std::string previously_invalidated_token;
« no previous file with comments | « jingle/notifier/base/notifier_options_util.cc ('k') | sync/engine/net/server_connection_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698