OLD | NEW |
---|---|
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef COMPONENTS_DATA_REDUCTION_PROXY_BROWSER_DATA_REDUCTION_PROXY_AUTH_REQUES T_HANDLER_H_ | 5 #ifndef COMPONENTS_DATA_REDUCTION_PROXY_BROWSER_DATA_REDUCTION_PROXY_AUTH_REQUES T_HANDLER_H_ |
6 #define COMPONENTS_DATA_REDUCTION_PROXY_BROWSER_DATA_REDUCTION_PROXY_AUTH_REQUES T_HANDLER_H_ | 6 #define COMPONENTS_DATA_REDUCTION_PROXY_BROWSER_DATA_REDUCTION_PROXY_AUTH_REQUES T_HANDLER_H_ |
7 | 7 |
8 #include "base/gtest_prod_util.h" | 8 #include "base/gtest_prod_util.h" |
9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
10 #include "base/strings/string16.h" | 10 #include "base/strings/string16.h" |
(...skipping 22 matching lines...) Expand all Loading... | |
33 extern const char kClientChromeIOS[]; | 33 extern const char kClientChromeIOS[]; |
34 | 34 |
35 class DataReductionProxyParams; | 35 class DataReductionProxyParams; |
36 | 36 |
37 class DataReductionProxyAuthRequestHandler { | 37 class DataReductionProxyAuthRequestHandler { |
38 public: | 38 public: |
39 static bool IsKeySetOnCommandLine(); | 39 static bool IsKeySetOnCommandLine(); |
40 | 40 |
41 DataReductionProxyAuthRequestHandler( | 41 DataReductionProxyAuthRequestHandler( |
42 const std::string& client, | 42 const std::string& client, |
43 const std::string& version, | 43 const std::string& build_number, |
bengr
2014/09/03 22:28:39
Why can't this just take a version and do the spli
| |
44 const std::string& patch_number, | |
44 DataReductionProxyParams* params, | 45 DataReductionProxyParams* params, |
45 scoped_refptr<base::SingleThreadTaskRunner> network_task_runner); | 46 scoped_refptr<base::SingleThreadTaskRunner> network_task_runner); |
46 | 47 |
47 virtual ~DataReductionProxyAuthRequestHandler(); | 48 virtual ~DataReductionProxyAuthRequestHandler(); |
48 | 49 |
49 // Adds a 'Chrome-Proxy' header to |request_headers| with the data reduction | 50 // Adds a 'Chrome-Proxy' header to |request_headers| with the data reduction |
50 // proxy authentication credentials. Only adds this header if the provided | 51 // proxy authentication credentials. Only adds this header if the provided |
51 // |proxy_server| is a data reduction proxy. Must be called on the IO thread. | 52 // |proxy_server| is a data reduction proxy. Must be called on the IO thread. |
52 void MaybeAddRequestHeader(net::URLRequest* request, | 53 void MaybeAddRequestHeader(net::URLRequest* request, |
53 const net::ProxyServer& proxy_server, | 54 const net::ProxyServer& proxy_server, |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
95 // Authentication state. | 96 // Authentication state. |
96 std::string key_; | 97 std::string key_; |
97 | 98 |
98 // Lives on the IO thread. | 99 // Lives on the IO thread. |
99 std::string session_; | 100 std::string session_; |
100 std::string credentials_; | 101 std::string credentials_; |
101 | 102 |
102 // Name of the client and version of the data reduction proxy protocol to use. | 103 // Name of the client and version of the data reduction proxy protocol to use. |
103 // Both live on the IO thread. | 104 // Both live on the IO thread. |
104 std::string client_; | 105 std::string client_; |
105 std::string version_; | 106 std::string build_number_; |
107 std::string patch_number_; | |
106 | 108 |
107 // The last time the session was updated. Used to ensure that a session is | 109 // The last time the session was updated. Used to ensure that a session is |
108 // never used for more than twenty-four hours. | 110 // never used for more than twenty-four hours. |
109 base::Time last_update_time_; | 111 base::Time last_update_time_; |
110 | 112 |
111 DataReductionProxyParams* data_reduction_proxy_params_; | 113 DataReductionProxyParams* data_reduction_proxy_params_; |
112 | 114 |
113 scoped_refptr<base::SingleThreadTaskRunner> network_task_runner_; | 115 scoped_refptr<base::SingleThreadTaskRunner> network_task_runner_; |
114 | 116 |
115 DISALLOW_COPY_AND_ASSIGN(DataReductionProxyAuthRequestHandler); | 117 DISALLOW_COPY_AND_ASSIGN(DataReductionProxyAuthRequestHandler); |
116 }; | 118 }; |
117 | 119 |
118 } // namespace data_reduction_proxy | 120 } // namespace data_reduction_proxy |
119 #endif // COMPONENTS_DATA_REDUCTION_PROXY_BROWSER_DATA_REDUCTION_PROXY_AUTH_REQ UEST_HANDLER_H_ | 121 #endif // COMPONENTS_DATA_REDUCTION_PROXY_BROWSER_DATA_REDUCTION_PROXY_AUTH_REQ UEST_HANDLER_H_ |
OLD | NEW |