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

Unified Diff: components/data_reduction_proxy/browser/data_reduction_proxy_auth_request_handler.h

Issue 465823002: Data reduction proxy sessions last no more than 24 hours (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 4 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 | components/data_reduction_proxy/browser/data_reduction_proxy_auth_request_handler.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/data_reduction_proxy/browser/data_reduction_proxy_auth_request_handler.h
diff --git a/components/data_reduction_proxy/browser/data_reduction_proxy_auth_request_handler.h b/components/data_reduction_proxy/browser/data_reduction_proxy_auth_request_handler.h
index 17b497a815fa17af9172003960978cd3b7706576..992b8b66e5e5d04435c02800d18ec686866f2c43 100644
--- a/components/data_reduction_proxy/browser/data_reduction_proxy_auth_request_handler.h
+++ b/components/data_reduction_proxy/browser/data_reduction_proxy_auth_request_handler.h
@@ -82,9 +82,15 @@ class DataReductionProxyAuthRequestHandler {
FRIEND_TEST_ALL_PREFIXES(DataReductionProxyAuthRequestHandlerTest,
AuthHashForSalt);
- void InitAuthentication(
- const std::string& session,
- const std::string& credentials);
+ // Stores the supplied key and sets up credentials suitable for authenticating
+ // with the data reduction proxy.
+ void InitAuthentication(const std::string& key);
+
+ // Generates a session ID and credentials suitable for authenticating with
+ // the data reduction proxy.
+ void ComputeCredentials(const base::Time& now,
+ std::string* session,
+ std::string* credentials);
// Authentication state.
std::string key_;
@@ -98,6 +104,10 @@ class DataReductionProxyAuthRequestHandler {
std::string client_;
std::string version_;
+ // The last time the session was updated. Used to ensure that a session is
+ // never used for more than twenty-four hours.
+ base::Time last_update_time_;
+
DataReductionProxyParams* data_reduction_proxy_params_;
scoped_refptr<base::SingleThreadTaskRunner> network_task_runner_;
« no previous file with comments | « no previous file | components/data_reduction_proxy/browser/data_reduction_proxy_auth_request_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698