Chromium Code Reviews| 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" |
| 11 #include "base/time/time.h" | 11 #include "base/time/time.h" |
| 12 #include "url/gurl.h" | 12 #include "url/gurl.h" |
| 13 | 13 |
| 14 namespace net { | 14 namespace net { |
| 15 class HttpRequestHeaders; | 15 class HttpRequestHeaders; |
| 16 class HttpResponseHeaders; | 16 class HttpResponseHeaders; |
| 17 class ProxyServer; | 17 class ProxyServer; |
| 18 class URLRequest; | 18 class URLRequest; |
| 19 } | 19 } |
| 20 | 20 |
| 21 namespace data_reduction_proxy { | 21 namespace data_reduction_proxy { |
| 22 | 22 |
| 23 extern const char kProtocolVersion[]; | |
| 24 | |
| 25 extern const char kClientAndroidWebview[]; | 23 extern const char kClientAndroidWebview[]; |
| 26 extern const char kClientChromeAndroid[]; | 24 extern const char kClientChromeAndroid[]; |
| 27 extern const char kClientChromeIOS[]; | 25 extern const char kClientChromeIOS[]; |
| 28 | 26 |
| 29 class DataReductionProxyParams; | 27 class DataReductionProxyParams; |
| 30 | 28 |
| 31 class DataReductionProxyAuthRequestHandler { | 29 class DataReductionProxyAuthRequestHandler { |
| 32 public: | 30 public: |
| 33 static bool IsKeySetOnCommandLine(); | 31 static bool IsKeySetOnCommandLine(); |
| 34 | 32 |
| 35 // Constructs an authentication request handler. | 33 // Constructs an authentication request handler. |
| 36 explicit DataReductionProxyAuthRequestHandler( | 34 explicit DataReductionProxyAuthRequestHandler( |
| 37 DataReductionProxyParams* params); | 35 DataReductionProxyParams* params, std::string version); |
|
bengr
2014/07/30 00:16:47
This should be const std::string& version and on i
megjablon
2014/07/30 20:37:17
Done.
| |
| 38 | 36 |
| 39 virtual ~DataReductionProxyAuthRequestHandler(); | 37 virtual ~DataReductionProxyAuthRequestHandler(); |
| 40 | 38 |
| 41 // Adds a 'Chrome-Proxy' header to |request_headers| with the data reduction | 39 // Adds a 'Chrome-Proxy' header to |request_headers| with the data reduction |
| 42 // proxy authentication credentials. Only adds this header if the provided | 40 // proxy authentication credentials. Only adds this header if the provided |
| 43 // |proxy_server| is a data reduction proxy. | 41 // |proxy_server| is a data reduction proxy. |
| 44 void MaybeAddRequestHeader(net::URLRequest* request, | 42 void MaybeAddRequestHeader(net::URLRequest* request, |
| 45 const net::ProxyServer& proxy_server, | 43 const net::ProxyServer& proxy_server, |
| 46 net::HttpRequestHeaders* request_headers); | 44 net::HttpRequestHeaders* request_headers); |
| 47 | 45 |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 89 std::string client_; | 87 std::string client_; |
| 90 std::string version_; | 88 std::string version_; |
| 91 | 89 |
| 92 DataReductionProxyParams* data_reduction_proxy_params_; | 90 DataReductionProxyParams* data_reduction_proxy_params_; |
| 93 | 91 |
| 94 DISALLOW_COPY_AND_ASSIGN(DataReductionProxyAuthRequestHandler); | 92 DISALLOW_COPY_AND_ASSIGN(DataReductionProxyAuthRequestHandler); |
| 95 }; | 93 }; |
| 96 | 94 |
| 97 } // namespace data_reduction_proxy | 95 } // namespace data_reduction_proxy |
| 98 #endif // COMPONENTS_DATA_REDUCTION_PROXY_BROWSER_DATA_REDUCTION_PROXY_AUTH_REQ UEST_HANDLER_H_ | 96 #endif // COMPONENTS_DATA_REDUCTION_PROXY_BROWSER_DATA_REDUCTION_PROXY_AUTH_REQ UEST_HANDLER_H_ |
| OLD | NEW |