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_CORE_BROWSER_DATA_REDUCTION_PROXY_AUTH_R
EQUEST_HANDLER_H_ | 5 #ifndef COMPONENTS_DATA_REDUCTION_PROXY_CORE_BROWSER_DATA_REDUCTION_PROXY_AUTH_R
EQUEST_HANDLER_H_ |
6 #define COMPONENTS_DATA_REDUCTION_PROXY_CORE_BROWSER_DATA_REDUCTION_PROXY_AUTH_R
EQUEST_HANDLER_H_ | 6 #define COMPONENTS_DATA_REDUCTION_PROXY_CORE_BROWSER_DATA_REDUCTION_PROXY_AUTH_R
EQUEST_HANDLER_H_ |
7 | 7 |
| 8 #include <stddef.h> |
| 9 #include <stdint.h> |
| 10 |
8 #include <string> | 11 #include <string> |
9 #include <vector> | 12 #include <vector> |
10 | 13 |
11 #include "base/gtest_prod_util.h" | 14 #include "base/gtest_prod_util.h" |
| 15 #include "base/macros.h" |
12 #include "base/strings/string16.h" | 16 #include "base/strings/string16.h" |
13 #include "base/threading/thread_checker.h" | 17 #include "base/threading/thread_checker.h" |
14 #include "base/time/time.h" | 18 #include "base/time/time.h" |
| 19 #include "build/build_config.h" |
15 | 20 |
16 namespace net { | 21 namespace net { |
17 class HostPortPair; | 22 class HostPortPair; |
18 class HttpRequestHeaders; | 23 class HttpRequestHeaders; |
19 class HttpResponseHeaders; | 24 class HttpResponseHeaders; |
20 class ProxyServer; | 25 class ProxyServer; |
21 class URLRequest; | 26 class URLRequest; |
22 } | 27 } |
23 | 28 |
24 namespace data_reduction_proxy { | 29 namespace data_reduction_proxy { |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
106 | 111 |
107 // Invalidates the secure session credentials. | 112 // Invalidates the secure session credentials. |
108 void Invalidate(); | 113 void Invalidate(); |
109 | 114 |
110 protected: | 115 protected: |
111 void SetHeader(net::HttpRequestHeaders* headers); | 116 void SetHeader(net::HttpRequestHeaders* headers); |
112 | 117 |
113 // Returns a UTF16 string that's the hash of the configured authentication | 118 // Returns a UTF16 string that's the hash of the configured authentication |
114 // |key| and |salt|. Returns an empty UTF16 string if no key is configured or | 119 // |key| and |salt|. Returns an empty UTF16 string if no key is configured or |
115 // the data reduction proxy feature isn't available. | 120 // the data reduction proxy feature isn't available. |
116 static base::string16 AuthHashForSalt(int64 salt, | 121 static base::string16 AuthHashForSalt(int64_t salt, const std::string& key); |
117 const std::string& key); | |
118 // Visible for testing. | 122 // Visible for testing. |
119 virtual base::Time Now() const; | 123 virtual base::Time Now() const; |
120 virtual void RandBytes(void* output, size_t length) const; | 124 virtual void RandBytes(void* output, size_t length) const; |
121 | 125 |
122 // Visible for testing. | 126 // Visible for testing. |
123 virtual std::string GetDefaultKey() const; | 127 virtual std::string GetDefaultKey() const; |
124 | 128 |
125 // Visible for testing. | 129 // Visible for testing. |
126 DataReductionProxyRequestOptions(Client client, | 130 DataReductionProxyRequestOptions(Client client, |
127 const std::string& version, | 131 const std::string& version, |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
196 DataReductionProxyConfig* data_reduction_proxy_config_; | 200 DataReductionProxyConfig* data_reduction_proxy_config_; |
197 | 201 |
198 // Enforce usage on the IO thread. | 202 // Enforce usage on the IO thread. |
199 base::ThreadChecker thread_checker_; | 203 base::ThreadChecker thread_checker_; |
200 | 204 |
201 DISALLOW_COPY_AND_ASSIGN(DataReductionProxyRequestOptions); | 205 DISALLOW_COPY_AND_ASSIGN(DataReductionProxyRequestOptions); |
202 }; | 206 }; |
203 | 207 |
204 } // namespace data_reduction_proxy | 208 } // namespace data_reduction_proxy |
205 #endif // COMPONENTS_DATA_REDUCTION_PROXY_CORE_BROWSER_DATA_REDUCTION_PROXY_AUT
H_REQUEST_HANDLER_H_ | 209 #endif // COMPONENTS_DATA_REDUCTION_PROXY_CORE_BROWSER_DATA_REDUCTION_PROXY_AUT
H_REQUEST_HANDLER_H_ |
OLD | NEW |