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

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

Issue 14888003: [Sync] Log age of auth tokens on authentication failure (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 7 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 | « chrome/browser/sync/profile_sync_service.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 917d5b427c699a4ad29bf52095cc90eda68a9767..df81e265605dcecfb8f46008cc084003c108c13f 100644
--- a/sync/engine/net/server_connection_manager.h
+++ b/sync/engine/net/server_connection_manager.h
@@ -224,16 +224,11 @@ class SYNC_EXPORT_PRIVATE ServerConnectionManager {
client_id_.assign(client_id);
}
- // Returns true if the auth token is succesfully set and false otherwise.
- bool set_auth_token(const std::string& auth_token) {
- DCHECK(thread_checker_.CalledOnValidThread());
- if (previously_invalidated_token != auth_token) {
- auth_token_.assign(auth_token);
- previously_invalidated_token = std::string();
- return true;
- }
- return false;
- }
+ // 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);
// 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
@@ -299,6 +294,10 @@ class SYNC_EXPORT_PRIVATE ServerConnectionManager {
// 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 | « chrome/browser/sync/profile_sync_service.cc ('k') | sync/engine/net/server_connection_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698