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: Created 7 years, 8 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
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..76609f984136f8ead5ffd383a3e81a6ec09b1e05 100644
--- a/sync/engine/net/server_connection_manager.h
+++ b/sync/engine/net/server_connection_manager.h
@@ -225,10 +225,12 @@ class SYNC_EXPORT_PRIVATE ServerConnectionManager {
}
// Returns true if the auth token is succesfully set and false otherwise.
- bool set_auth_token(const std::string& auth_token) {
+ bool set_auth_token(const std::string& auth_token,
tim (not reviewing) 2013/05/03 00:46:43 This method should be renamed as per style guide (
Nicolas Zea 2013/05/03 01:31:41 Done.
+ const base::Time& auth_token_time) {
DCHECK(thread_checker_.CalledOnValidThread());
if (previously_invalidated_token != auth_token) {
auth_token_.assign(auth_token);
+ auth_token_time_ = auth_token_time;
previously_invalidated_token = std::string();
return true;
}
@@ -299,6 +301,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;

Powered by Google App Engine
This is Rietveld 408576698