| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 "base/scoped_ptr.h" | 7 #include "base/scoped_ptr.h" |
| 8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
| 9 #include "base/string_util.h" | 9 #include "base/string_util.h" |
| 10 #include "base/trace_event.h" | 10 #include "base/trace_event.h" |
| (...skipping 875 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 886 next_state_ = STATE_DRAIN_BODY_FOR_AUTH_RESTART; | 886 next_state_ = STATE_DRAIN_BODY_FOR_AUTH_RESTART; |
| 887 } | 887 } |
| 888 | 888 |
| 889 return OK; | 889 return OK; |
| 890 } | 890 } |
| 891 | 891 |
| 892 void HttpNetworkTransaction::LogTransactionMetrics() const { | 892 void HttpNetworkTransaction::LogTransactionMetrics() const { |
| 893 base::TimeDelta duration = base::Time::Now() - response_.request_time; | 893 base::TimeDelta duration = base::Time::Now() - response_.request_time; |
| 894 if (60 < duration.InMinutes()) | 894 if (60 < duration.InMinutes()) |
| 895 return; | 895 return; |
| 896 UMA_HISTOGRAM_LONG_TIMES(L"Net.Transaction_Latency", duration); | 896 UMA_HISTOGRAM_LONG_TIMES("Net.Transaction_Latency", duration); |
| 897 if (!duration.InMilliseconds()) | 897 if (!duration.InMilliseconds()) |
| 898 return; | 898 return; |
| 899 UMA_HISTOGRAM_COUNTS(L"Net.Transaction_Bandwidth", | 899 UMA_HISTOGRAM_COUNTS("Net.Transaction_Bandwidth", |
| 900 static_cast<int> (content_read_ / duration.InMilliseconds())); | 900 static_cast<int> (content_read_ / duration.InMilliseconds())); |
| 901 } | 901 } |
| 902 | 902 |
| 903 int HttpNetworkTransaction::DidReadResponseHeaders() { | 903 int HttpNetworkTransaction::DidReadResponseHeaders() { |
| 904 scoped_refptr<HttpResponseHeaders> headers; | 904 scoped_refptr<HttpResponseHeaders> headers; |
| 905 if (has_found_status_line_start()) { | 905 if (has_found_status_line_start()) { |
| 906 headers = new HttpResponseHeaders( | 906 headers = new HttpResponseHeaders( |
| 907 HttpUtil::AssembleRawHeaders( | 907 HttpUtil::AssembleRawHeaders( |
| 908 header_buf_.get(), header_buf_body_offset_)); | 908 header_buf_.get(), header_buf_body_offset_)); |
| 909 } else { | 909 } else { |
| (...skipping 456 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1366 if (target == HttpAuth::AUTH_PROXY) { | 1366 if (target == HttpAuth::AUTH_PROXY) { |
| 1367 auth_info->host = ASCIIToWide(proxy_info_.proxy_server().host_and_port()); | 1367 auth_info->host = ASCIIToWide(proxy_info_.proxy_server().host_and_port()); |
| 1368 } else { | 1368 } else { |
| 1369 DCHECK(target == HttpAuth::AUTH_SERVER); | 1369 DCHECK(target == HttpAuth::AUTH_SERVER); |
| 1370 auth_info->host = ASCIIToWide(request_->url.host()); | 1370 auth_info->host = ASCIIToWide(request_->url.host()); |
| 1371 } | 1371 } |
| 1372 response_.auth_challenge = auth_info; | 1372 response_.auth_challenge = auth_info; |
| 1373 } | 1373 } |
| 1374 | 1374 |
| 1375 } // namespace net | 1375 } // namespace net |
| OLD | NEW |