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 #include "components/data_reduction_proxy/browser/data_reduction_proxy_protocol.
h" | 5 #include "components/data_reduction_proxy/browser/data_reduction_proxy_protocol.
h" |
6 | 6 |
7 #include "base/memory/ref_counted.h" | 7 #include "base/memory/ref_counted.h" |
8 #include "base/time/time.h" | 8 #include "base/time/time.h" |
9 #include "components/data_reduction_proxy/browser/data_reduction_proxy_params.h" | 9 #include "components/data_reduction_proxy/browser/data_reduction_proxy_params.h" |
10 #include "components/data_reduction_proxy/browser/data_reduction_proxy_tamper_de
tection.h" | 10 #include "components/data_reduction_proxy/browser/data_reduction_proxy_tamper_de
tection.h" |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 const net::HttpResponseHeaders* original_response_headers, | 46 const net::HttpResponseHeaders* original_response_headers, |
47 scoped_refptr<net::HttpResponseHeaders>* override_response_headers, | 47 scoped_refptr<net::HttpResponseHeaders>* override_response_headers, |
48 DataReductionProxyBypassType* proxy_bypass_type) { | 48 DataReductionProxyBypassType* proxy_bypass_type) { |
49 if (!data_reduction_proxy_params) | 49 if (!data_reduction_proxy_params) |
50 return false; | 50 return false; |
51 DataReductionProxyTypeInfo data_reduction_proxy_type_info; | 51 DataReductionProxyTypeInfo data_reduction_proxy_type_info; |
52 if (!data_reduction_proxy_params->WasDataReductionProxyUsed( | 52 if (!data_reduction_proxy_params->WasDataReductionProxyUsed( |
53 request, &data_reduction_proxy_type_info)) { | 53 request, &data_reduction_proxy_type_info)) { |
54 return false; | 54 return false; |
55 } | 55 } |
| 56 // TODO(bengr): Implement bypass for CONNECT tunnel. |
| 57 if (data_reduction_proxy_type_info.is_ssl) |
| 58 return false; |
56 | 59 |
57 // Empty implies either that the request was served from cache or that | 60 // Empty implies either that the request was served from cache or that |
58 // request was served directly from the origin. | 61 // request was served directly from the origin. |
59 if (request->proxy_server().IsEmpty()) | 62 if (request->proxy_server().IsEmpty()) |
60 return false; | 63 return false; |
61 | 64 |
62 if (data_reduction_proxy_type_info.proxy_servers.first.is_empty()) | 65 if (data_reduction_proxy_type_info.proxy_servers.first.is_empty()) |
63 return false; | 66 return false; |
64 | 67 |
65 DataReductionProxyTamperDetection::DetectAndReport( | 68 DataReductionProxyTamperDetection::DetectAndReport( |
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
194 net::ProxyService* proxy_service = request->context()->proxy_service(); | 197 net::ProxyService* proxy_service = request->context()->proxy_service(); |
195 DCHECK(proxy_service); | 198 DCHECK(proxy_service); |
196 | 199 |
197 proxy_service->MarkProxiesAsBadUntil(proxy_info, | 200 proxy_service->MarkProxiesAsBadUntil(proxy_info, |
198 bypass_duration, | 201 bypass_duration, |
199 fallback, | 202 fallback, |
200 request->net_log()); | 203 request->net_log()); |
201 } | 204 } |
202 | 205 |
203 } // namespace data_reduction_proxy | 206 } // namespace data_reduction_proxy |
OLD | NEW |