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/core/browser/data_reduction_proxy_bypa
ss_protocol.h" | 5 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_bypa
ss_protocol.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/metrics/histogram_macros.h" | 9 #include "base/metrics/histogram_macros.h" |
10 #include "base/strings/string_number_conversions.h" | 10 #include "base/strings/string_number_conversions.h" |
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
136 return false; | 136 return false; |
137 | 137 |
138 // At this point, the response is expected to have the data reduction proxy | 138 // At this point, the response is expected to have the data reduction proxy |
139 // via header, so detect and report cases where the via header is missing. | 139 // via header, so detect and report cases where the via header is missing. |
140 DataReductionProxyBypassStats::DetectAndRecordMissingViaHeaderResponseCode( | 140 DataReductionProxyBypassStats::DetectAndRecordMissingViaHeaderResponseCode( |
141 data_reduction_proxy_type_info.proxy_index == 0, response_headers); | 141 data_reduction_proxy_type_info.proxy_index == 0, response_headers); |
142 | 142 |
143 // GetDataReductionProxyBypassType will only log a net_log event if a bypass | 143 // GetDataReductionProxyBypassType will only log a net_log event if a bypass |
144 // command was sent via the data reduction proxy headers | 144 // command was sent via the data reduction proxy headers |
145 DataReductionProxyBypassType bypass_type = GetDataReductionProxyBypassType( | 145 DataReductionProxyBypassType bypass_type = GetDataReductionProxyBypassType( |
146 response_headers, data_reduction_proxy_info); | 146 request->url_chain(), *response_headers, data_reduction_proxy_info); |
147 | 147 |
148 if (proxy_bypass_type) | 148 if (proxy_bypass_type) |
149 *proxy_bypass_type = bypass_type; | 149 *proxy_bypass_type = bypass_type; |
150 if (bypass_type == BYPASS_EVENT_TYPE_MAX) | 150 if (bypass_type == BYPASS_EVENT_TYPE_MAX) |
151 return false; | 151 return false; |
152 | 152 |
153 DCHECK(request->context()); | 153 DCHECK(request->context()); |
154 DCHECK(request->context()->proxy_service()); | 154 DCHECK(request->context()->proxy_service()); |
155 net::ProxyServer proxy_server = | 155 net::ProxyServer proxy_server = |
156 data_reduction_proxy_type_info.proxy_servers.front(); | 156 data_reduction_proxy_type_info.proxy_servers.front(); |
(...skipping 16 matching lines...) Expand all Loading... |
173 net::LOAD_DISABLE_CACHE | | 173 net::LOAD_DISABLE_CACHE | |
174 net::LOAD_BYPASS_PROXY); | 174 net::LOAD_BYPASS_PROXY); |
175 } | 175 } |
176 | 176 |
177 // Retry if block-once was specified or if method is idempotent. | 177 // Retry if block-once was specified or if method is idempotent. |
178 return bypass_type == BYPASS_EVENT_TYPE_CURRENT || | 178 return bypass_type == BYPASS_EVENT_TYPE_CURRENT || |
179 util::IsMethodIdempotent(request->method()); | 179 util::IsMethodIdempotent(request->method()); |
180 } | 180 } |
181 | 181 |
182 } // namespace data_reduction_proxy | 182 } // namespace data_reduction_proxy |
OLD | NEW |