OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "net/http/http_network_transaction.h" | 5 #include "net/http/http_network_transaction.h" |
6 | 6 |
7 #include <set> | 7 #include <set> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 994 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1005 } | 1005 } |
1006 #endif | 1006 #endif |
1007 | 1007 |
1008 if (data_reduction_proxy_used || data_reduction_fallback_proxy_used) { | 1008 if (data_reduction_proxy_used || data_reduction_fallback_proxy_used) { |
1009 net::HttpResponseHeaders::DataReductionProxyInfo | 1009 net::HttpResponseHeaders::DataReductionProxyInfo |
1010 data_reduction_proxy_info; | 1010 data_reduction_proxy_info; |
1011 proxy_bypass_event | 1011 proxy_bypass_event |
1012 = response_.headers->GetDataReductionProxyBypassEventType( | 1012 = response_.headers->GetDataReductionProxyBypassEventType( |
1013 &data_reduction_proxy_info); | 1013 &data_reduction_proxy_info); |
1014 if (proxy_bypass_event < ProxyService::BYPASS_EVENT_TYPE_MAX) { | 1014 if (proxy_bypass_event < ProxyService::BYPASS_EVENT_TYPE_MAX) { |
1015 // Bypass all proxies for one second on reception of a 4xx that | |
1016 // originated at the proxy. | |
Matt Welsh
2014/05/23 23:56:30
We shouldn't be bypassing all 4xx errors. This sho
bengr
2014/05/24 01:22:02
GetDataReductionBypassEventType decides if we shou
| |
1017 if (proxy_bypass_event == ProxyService::CLIENT_ERROR_BYPASS) { | |
1018 data_reduction_proxy_info.bypass_all = true; | |
1019 data_reduction_proxy_info.bypass_duration = | |
1020 base::TimeDelta::FromSeconds(1); | |
1021 } | |
1022 | |
1015 ProxyService* proxy_service = session_->proxy_service(); | 1023 ProxyService* proxy_service = session_->proxy_service(); |
1016 | 1024 |
1017 proxy_service->RecordDataReductionProxyBypassInfo( | 1025 proxy_service->RecordDataReductionProxyBypassInfo( |
1018 data_reduction_proxy_used, proxy_info_.proxy_server(), | 1026 data_reduction_proxy_used, proxy_info_.proxy_server(), |
1019 proxy_bypass_event); | 1027 proxy_bypass_event); |
1020 | 1028 |
1021 ProxyServer proxy_server; | 1029 ProxyServer proxy_server; |
1022 #if defined(DATA_REDUCTION_FALLBACK_HOST) | 1030 #if defined(DATA_REDUCTION_FALLBACK_HOST) |
1023 if (data_reduction_proxy_used && data_reduction_proxy_info.bypass_all) { | 1031 if (data_reduction_proxy_used && data_reduction_proxy_info.bypass_all) { |
1024 // TODO(bengr): Rename as DATA_REDUCTION_FALLBACK_ORIGIN. | 1032 // TODO(bengr): Rename as DATA_REDUCTION_FALLBACK_ORIGIN. |
(...skipping 586 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1611 description = base::StringPrintf("Unknown state 0x%08X (%u)", state, | 1619 description = base::StringPrintf("Unknown state 0x%08X (%u)", state, |
1612 state); | 1620 state); |
1613 break; | 1621 break; |
1614 } | 1622 } |
1615 return description; | 1623 return description; |
1616 } | 1624 } |
1617 | 1625 |
1618 #undef STATE_CASE | 1626 #undef STATE_CASE |
1619 | 1627 |
1620 } // namespace net | 1628 } // namespace net |
OLD | NEW |