Chromium Code Reviews| 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 969 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 980 } | 980 } |
| 981 | 981 |
| 982 if (proxy_bypass_event < ProxyService::BYPASS_EVENT_TYPE_MAX) { | 982 if (proxy_bypass_event < ProxyService::BYPASS_EVENT_TYPE_MAX) { |
| 983 ProxyService* proxy_service = session_->proxy_service(); | 983 ProxyService* proxy_service = session_->proxy_service(); |
| 984 | 984 |
| 985 proxy_service->RecordDataReductionProxyBypassInfo( | 985 proxy_service->RecordDataReductionProxyBypassInfo( |
| 986 chrome_proxy_used, proxy_info_.proxy_server(), proxy_bypass_event); | 986 chrome_proxy_used, proxy_info_.proxy_server(), proxy_bypass_event); |
| 987 | 987 |
| 988 if (proxy_service->MarkProxyAsBad(proxy_info_, bypass_duration, | 988 if (proxy_service->MarkProxyAsBad(proxy_info_, bypass_duration, |
| 989 net_log_)) { | 989 net_log_)) { |
| 990 // Only retry in the case of GETs. We don't want to resubmit a POST | 990 // Only retry idempotent methods. |
| 991 // if the proxy took some action. | 991 if (request_->method == "GET" || |
|
mef
2013/12/18 16:34:41
Is request_->method guaranteed to be upper case?
bengr
2013/12/18 19:39:47
Yes. From RFC 2616, sec 5.1.1 Method:
"The Method
| |
| 992 if (request_->method == "GET") { | 992 request_->method == "OPTIONS" || |
| 993 request_->method == "HEAD" || | |
| 994 request_->method == "PUT" || | |
| 995 request_->method == "DELETE" || | |
| 996 request_->method == "TRACE") { | |
| 993 ResetConnectionAndRequestForResend(); | 997 ResetConnectionAndRequestForResend(); |
| 994 return OK; | 998 return OK; |
| 995 } | 999 } |
| 996 } | 1000 } |
| 997 } | 1001 } |
| 998 } | 1002 } |
| 999 } | 1003 } |
| 1000 #endif | 1004 #endif |
| 1001 | 1005 |
| 1002 // Like Net.HttpResponseCode, but only for MAIN_FRAME loads. | 1006 // Like Net.HttpResponseCode, but only for MAIN_FRAME loads. |
| (...skipping 538 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1541 description = base::StringPrintf("Unknown state 0x%08X (%u)", state, | 1545 description = base::StringPrintf("Unknown state 0x%08X (%u)", state, |
| 1542 state); | 1546 state); |
| 1543 break; | 1547 break; |
| 1544 } | 1548 } |
| 1545 return description; | 1549 return description; |
| 1546 } | 1550 } |
| 1547 | 1551 |
| 1548 #undef STATE_CASE | 1552 #undef STATE_CASE |
| 1549 | 1553 |
| 1550 } // namespace net | 1554 } // namespace net |
| OLD | NEW |