| 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 18 matching lines...) Expand all Loading... |
| 29 #include "net/base/net_errors.h" | 29 #include "net/base/net_errors.h" |
| 30 #include "net/base/net_util.h" | 30 #include "net/base/net_util.h" |
| 31 #include "net/base/ssl_cert_request_info.h" | 31 #include "net/base/ssl_cert_request_info.h" |
| 32 #include "net/base/ssl_connection_status_flags.h" | 32 #include "net/base/ssl_connection_status_flags.h" |
| 33 #include "net/base/upload_data_stream.h" | 33 #include "net/base/upload_data_stream.h" |
| 34 #include "net/http/http_auth.h" | 34 #include "net/http/http_auth.h" |
| 35 #include "net/http/http_auth_handler.h" | 35 #include "net/http/http_auth_handler.h" |
| 36 #include "net/http/http_auth_handler_factory.h" | 36 #include "net/http/http_auth_handler_factory.h" |
| 37 #include "net/http/http_basic_stream.h" | 37 #include "net/http/http_basic_stream.h" |
| 38 #include "net/http/http_chunked_decoder.h" | 38 #include "net/http/http_chunked_decoder.h" |
| 39 #include "net/http/http_net_log_params.h" | |
| 40 #include "net/http/http_network_session.h" | 39 #include "net/http/http_network_session.h" |
| 41 #include "net/http/http_proxy_client_socket.h" | 40 #include "net/http/http_proxy_client_socket.h" |
| 42 #include "net/http/http_proxy_client_socket_pool.h" | 41 #include "net/http/http_proxy_client_socket_pool.h" |
| 43 #include "net/http/http_request_headers.h" | 42 #include "net/http/http_request_headers.h" |
| 44 #include "net/http/http_request_info.h" | 43 #include "net/http/http_request_info.h" |
| 45 #include "net/http/http_response_headers.h" | 44 #include "net/http/http_response_headers.h" |
| 46 #include "net/http/http_response_info.h" | 45 #include "net/http/http_response_info.h" |
| 47 #include "net/http/http_server_properties.h" | 46 #include "net/http/http_server_properties.h" |
| 48 #include "net/http/http_status_code.h" | 47 #include "net/http/http_status_code.h" |
| 49 #include "net/http/http_stream_factory.h" | 48 #include "net/http/http_stream_factory.h" |
| (...skipping 815 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 865 } | 864 } |
| 866 DCHECK(response_.headers); | 865 DCHECK(response_.headers); |
| 867 | 866 |
| 868 // Like Net.HttpResponseCode, but only for MAIN_FRAME loads. | 867 // Like Net.HttpResponseCode, but only for MAIN_FRAME loads. |
| 869 if (request_->load_flags & LOAD_MAIN_FRAME) { | 868 if (request_->load_flags & LOAD_MAIN_FRAME) { |
| 870 const int response_code = response_.headers->response_code(); | 869 const int response_code = response_.headers->response_code(); |
| 871 UMA_HISTOGRAM_ENUMERATION( | 870 UMA_HISTOGRAM_ENUMERATION( |
| 872 "Net.HttpResponseCode_Nxx_MainFrame", response_code/100, 10); | 871 "Net.HttpResponseCode_Nxx_MainFrame", response_code/100, 10); |
| 873 } | 872 } |
| 874 | 873 |
| 875 if (net_log_.IsLoggingAllEvents()) { | 874 net_log_.AddEvent( |
| 876 net_log_.AddEvent( | 875 NetLog::TYPE_HTTP_TRANSACTION_READ_RESPONSE_HEADERS, |
| 877 NetLog::TYPE_HTTP_TRANSACTION_READ_RESPONSE_HEADERS, | 876 base::Bind(&HttpResponseHeaders::NetLogCallback, response_.headers)); |
| 878 make_scoped_refptr(new NetLogHttpResponseParameter(response_.headers))); | |
| 879 } | |
| 880 | 877 |
| 881 if (response_.headers->GetParsedHttpVersion() < HttpVersion(1, 0)) { | 878 if (response_.headers->GetParsedHttpVersion() < HttpVersion(1, 0)) { |
| 882 // HTTP/0.9 doesn't support the PUT method, so lack of response headers | 879 // HTTP/0.9 doesn't support the PUT method, so lack of response headers |
| 883 // indicates a buggy server. See: | 880 // indicates a buggy server. See: |
| 884 // https://bugzilla.mozilla.org/show_bug.cgi?id=193921 | 881 // https://bugzilla.mozilla.org/show_bug.cgi?id=193921 |
| 885 if (request_->method == "PUT") | 882 if (request_->method == "PUT") |
| 886 return ERR_METHOD_NOT_SUPPORTED; | 883 return ERR_METHOD_NOT_SUPPORTED; |
| 887 } | 884 } |
| 888 | 885 |
| 889 // Check for an intermediate 100 Continue response. An origin server is | 886 // Check for an intermediate 100 Continue response. An origin server is |
| (...skipping 543 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1433 description = base::StringPrintf("Unknown state 0x%08X (%u)", state, | 1430 description = base::StringPrintf("Unknown state 0x%08X (%u)", state, |
| 1434 state); | 1431 state); |
| 1435 break; | 1432 break; |
| 1436 } | 1433 } |
| 1437 return description; | 1434 return description; |
| 1438 } | 1435 } |
| 1439 | 1436 |
| 1440 #undef STATE_CASE | 1437 #undef STATE_CASE |
| 1441 | 1438 |
| 1442 } // namespace net | 1439 } // namespace net |
| OLD | NEW |