Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(107)

Side by Side Diff: net/http/http_network_transaction.cc

Issue 298883011: Record errors that trigger a data reduction proxy bypass (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: addressed more comments from mef Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 991 matching lines...) Expand 10 before | Expand all | Expand 10 after
1002 } 1002 }
1003 #endif 1003 #endif
1004 1004
1005 if (data_reduction_proxy_used || data_reduction_fallback_proxy_used) { 1005 if (data_reduction_proxy_used || data_reduction_fallback_proxy_used) {
1006 net::HttpResponseHeaders::DataReductionProxyInfo 1006 net::HttpResponseHeaders::DataReductionProxyInfo
1007 data_reduction_proxy_info; 1007 data_reduction_proxy_info;
1008 proxy_bypass_event 1008 proxy_bypass_event
1009 = response_.headers->GetDataReductionProxyBypassEventType( 1009 = response_.headers->GetDataReductionProxyBypassEventType(
1010 &data_reduction_proxy_info); 1010 &data_reduction_proxy_info);
1011 if (proxy_bypass_event < ProxyService::BYPASS_EVENT_TYPE_MAX) { 1011 if (proxy_bypass_event < ProxyService::BYPASS_EVENT_TYPE_MAX) {
1012 // Bypass all proxies for one second on reception of a 4xx that
1013 // originated at the proxy.
1014 if (proxy_bypass_event == ProxyService::PROXY_4XX_BYPASS) {
1015 data_reduction_proxy_info.bypass_all = true;
1016 data_reduction_proxy_info.bypass_duration =
1017 base::TimeDelta::FromSeconds(1);
1018 }
1019
1012 ProxyService* proxy_service = session_->proxy_service(); 1020 ProxyService* proxy_service = session_->proxy_service();
1013 1021
1014 proxy_service->RecordDataReductionProxyBypassInfo( 1022 proxy_service->RecordDataReductionProxyBypassInfo(
1015 data_reduction_proxy_used, proxy_info_.proxy_server(), 1023 data_reduction_proxy_used, proxy_info_.proxy_server(),
1016 proxy_bypass_event); 1024 proxy_bypass_event);
1017 1025
1018 ProxyServer proxy_server; 1026 ProxyServer proxy_server;
1019 #if defined(DATA_REDUCTION_FALLBACK_HOST) 1027 #if defined(DATA_REDUCTION_FALLBACK_HOST)
1020 if (data_reduction_proxy_used && data_reduction_proxy_info.bypass_all) { 1028 if (data_reduction_proxy_used && data_reduction_proxy_info.bypass_all) {
1021 // TODO(bengr): Rename as DATA_REDUCTION_FALLBACK_ORIGIN. 1029 // TODO(bengr): Rename as DATA_REDUCTION_FALLBACK_ORIGIN.
(...skipping 577 matching lines...) Expand 10 before | Expand all | Expand 10 after
1599 description = base::StringPrintf("Unknown state 0x%08X (%u)", state, 1607 description = base::StringPrintf("Unknown state 0x%08X (%u)", state,
1600 state); 1608 state);
1601 break; 1609 break;
1602 } 1610 }
1603 return description; 1611 return description;
1604 } 1612 }
1605 1613
1606 #undef STATE_CASE 1614 #undef STATE_CASE
1607 1615
1608 } // namespace net 1616 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698