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 ca913c62df380d0bcae3c20a6545f9bc3102dc1a..c6784770d92165e50dc4fee69f92a4bb59d51a53 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 |
@@ -11,6 +11,10 @@ |
#include "base/time/time.h" |
#include "url/gurl.h" |
+namespace base { |
+class MessageLoopProxy; |
+} |
+ |
namespace net { |
class HttpRequestHeaders; |
class HttpResponseHeaders; |
@@ -34,13 +38,14 @@ class DataReductionProxyAuthRequestHandler { |
// Constructs an authentication request handler. |
explicit DataReductionProxyAuthRequestHandler( |
- DataReductionProxyParams* params); |
+ DataReductionProxyParams* params, |
+ base::MessageLoopProxy* io_thread_proxy); |
willchan no longer on Chromium
2014/07/31 22:31:35
Please use SingleThreadTaskRunner instead. MLP is
bengr
2014/08/02 01:10:32
Done.
|
virtual ~DataReductionProxyAuthRequestHandler(); |
// Adds a 'Chrome-Proxy' header to |request_headers| with the data reduction |
// proxy authentication credentials. Only adds this header if the provided |
- // |proxy_server| is a data reduction proxy. |
+ // |proxy_server| is a data reduction proxy. Must be called on the IO thread. |
void MaybeAddRequestHeader(net::URLRequest* request, |
const net::ProxyServer& proxy_server, |
net::HttpRequestHeaders* request_headers); |
@@ -51,14 +56,16 @@ class DataReductionProxyAuthRequestHandler { |
// should be defined in this file as one of |kClient...|. Version is the |
// authentication protocol version that the client uses, which should be |
// |kProtocolVersion| unless the client expects to be handled differently from |
- // the standard behavior. |
+ // the standard behavior. Must be called on the UI Thread. |
willchan no longer on Chromium
2014/07/31 22:31:35
Since this object primarily lives on the IO thread
bengr
2014/08/02 01:10:32
Done.
|
void SetKey(const std::string& key, |
const std::string& client, |
const std::string& version); |
protected: |
void Init(); |
- void InitAuthentication(const std::string& key); |
+ void InitAuthentication(const std::string& key, |
+ const std::string& client, |
+ const std::string& version); |
void AddAuthorizationHeader(net::HttpRequestHeaders* headers); |
@@ -80,17 +87,28 @@ class DataReductionProxyAuthRequestHandler { |
FRIEND_TEST_ALL_PREFIXES(DataReductionProxyAuthRequestHandlerTest, |
AuthHashForSalt); |
+ void InitAuthenticationOnIOThread( |
marq (ping after 24h)
2014/07/31 23:54:32
Symmetrically with Will's comments, if this is pri
bengr
2014/08/02 01:10:32
Done.
|
+ const std::string& session, |
+ const std::string& credentials, |
+ const std::string& client, |
+ const std::string& version); |
+ |
// Authentication state. |
std::string key_; |
+ |
+ // Lives on the IO thread. |
std::string session_; |
std::string credentials_; |
// Name of the client and version of the data reduction proxy protocol to use. |
+ // Both live on the IO thread. |
std::string client_; |
std::string version_; |
DataReductionProxyParams* data_reduction_proxy_params_; |
+ base::MessageLoopProxy* io_thread_proxy_; |
+ |
DISALLOW_COPY_AND_ASSIGN(DataReductionProxyAuthRequestHandler); |
}; |