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/url_request/url_request_http_job.h" | 5 #include "net/url_request/url_request_http_job.h" |
6 | 6 |
7 #include "base/base_switches.h" | 7 #include "base/base_switches.h" |
8 #include "base/bind.h" | 8 #include "base/bind.h" |
9 #include "base/bind_helpers.h" | 9 #include "base/bind_helpers.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 1475 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1486 if (request_creation_time_.is_null()) { | 1486 if (request_creation_time_.is_null()) { |
1487 NOTREACHED() | 1487 NOTREACHED() |
1488 << "The same transaction shouldn't start twice without new timing."; | 1488 << "The same transaction shouldn't start twice without new timing."; |
1489 return; | 1489 return; |
1490 } | 1490 } |
1491 | 1491 |
1492 base::TimeDelta to_start = base::Time::Now() - request_creation_time_; | 1492 base::TimeDelta to_start = base::Time::Now() - request_creation_time_; |
1493 request_creation_time_ = base::Time(); | 1493 request_creation_time_ = base::Time(); |
1494 | 1494 |
1495 UMA_HISTOGRAM_MEDIUM_TIMES("Net.HttpTimeToFirstByte", to_start); | 1495 UMA_HISTOGRAM_MEDIUM_TIMES("Net.HttpTimeToFirstByte", to_start); |
| 1496 if (request_info_.upload_data_stream && |
| 1497 request_info_.upload_data_stream->size() > 1024 * 1024) { |
| 1498 UMA_HISTOGRAM_MEDIUM_TIMES("Net.HttpTimeToFirstByte.LargeUpload", to_start); |
| 1499 } |
1496 } | 1500 } |
1497 | 1501 |
1498 void URLRequestHttpJob::ResetTimer() { | 1502 void URLRequestHttpJob::ResetTimer() { |
1499 if (!request_creation_time_.is_null()) { | 1503 if (!request_creation_time_.is_null()) { |
1500 NOTREACHED() | 1504 NOTREACHED() |
1501 << "The timer was reset before it was recorded."; | 1505 << "The timer was reset before it was recorded."; |
1502 return; | 1506 return; |
1503 } | 1507 } |
1504 request_creation_time_ = base::Time::Now(); | 1508 request_creation_time_ = base::Time::Now(); |
1505 } | 1509 } |
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1650 // Notify NetworkQualityEstimator. | 1654 // Notify NetworkQualityEstimator. |
1651 if (request()) { | 1655 if (request()) { |
1652 NetworkQualityEstimator* network_quality_estimator = | 1656 NetworkQualityEstimator* network_quality_estimator = |
1653 request()->context()->network_quality_estimator(); | 1657 request()->context()->network_quality_estimator(); |
1654 if (network_quality_estimator) | 1658 if (network_quality_estimator) |
1655 network_quality_estimator->NotifyURLRequestDestroyed(*request()); | 1659 network_quality_estimator->NotifyURLRequestDestroyed(*request()); |
1656 } | 1660 } |
1657 } | 1661 } |
1658 | 1662 |
1659 } // namespace net | 1663 } // namespace net |
OLD | NEW |