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 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 return false; | 66 return false; |
67 | 67 |
68 DataReductionProxyTamperDetection::DetectAndReport( | 68 DataReductionProxyTamperDetection::DetectAndReport( |
69 original_response_headers, | 69 original_response_headers, |
70 data_reduction_proxy_type_info.proxy_servers.first.SchemeIsSecure()); | 70 data_reduction_proxy_type_info.proxy_servers.first.SchemeIsSecure()); |
71 | 71 |
72 DataReductionProxyInfo data_reduction_proxy_info; | 72 DataReductionProxyInfo data_reduction_proxy_info; |
73 DataReductionProxyBypassType bypass_type = | 73 DataReductionProxyBypassType bypass_type = |
74 GetDataReductionProxyBypassType(original_response_headers, | 74 GetDataReductionProxyBypassType(original_response_headers, |
75 &data_reduction_proxy_info); | 75 &data_reduction_proxy_info); |
| 76 |
| 77 if (bypass_type == BYPASS_EVENT_TYPE_MISSING_VIA_HEADER_OTHER && |
| 78 DataReductionProxyParams:: |
| 79 IsIncludedInRemoveMissingViaHeaderOtherBypassFieldTrial()) { |
| 80 // Ignore MISSING_VIA_HEADER_OTHER proxy bypass events if the client is part |
| 81 // of the field trial to remove these kinds of bypasses. |
| 82 bypass_type = BYPASS_EVENT_TYPE_MAX; |
| 83 } |
| 84 |
76 if (proxy_bypass_type) | 85 if (proxy_bypass_type) |
77 *proxy_bypass_type = bypass_type; | 86 *proxy_bypass_type = bypass_type; |
78 if (bypass_type == BYPASS_EVENT_TYPE_MAX) | 87 if (bypass_type == BYPASS_EVENT_TYPE_MAX) |
79 return false; | 88 return false; |
80 | 89 |
81 DCHECK(request->context()); | 90 DCHECK(request->context()); |
82 DCHECK(request->context()->proxy_service()); | 91 DCHECK(request->context()->proxy_service()); |
83 net::ProxyServer proxy_server; | 92 net::ProxyServer proxy_server; |
84 SetProxyServerFromGURL( | 93 SetProxyServerFromGURL( |
85 data_reduction_proxy_type_info.proxy_servers.first, &proxy_server); | 94 data_reduction_proxy_type_info.proxy_servers.first, &proxy_server); |
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
197 net::ProxyService* proxy_service = request->context()->proxy_service(); | 206 net::ProxyService* proxy_service = request->context()->proxy_service(); |
198 DCHECK(proxy_service); | 207 DCHECK(proxy_service); |
199 | 208 |
200 proxy_service->MarkProxiesAsBadUntil(proxy_info, | 209 proxy_service->MarkProxiesAsBadUntil(proxy_info, |
201 bypass_duration, | 210 bypass_duration, |
202 fallback, | 211 fallback, |
203 request->net_log()); | 212 request->net_log()); |
204 } | 213 } |
205 | 214 |
206 } // namespace data_reduction_proxy | 215 } // namespace data_reduction_proxy |
OLD | NEW |