| 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 <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/base_switches.h" | 9 #include "base/base_switches.h" |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 1466 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1477 bool used_quic = response_info_->DidUseQuic(); | 1477 bool used_quic = response_info_->DidUseQuic(); |
| 1478 if (is_https_google) { | 1478 if (is_https_google) { |
| 1479 if (used_quic) { | 1479 if (used_quic) { |
| 1480 UMA_HISTOGRAM_MEDIUM_TIMES("Net.HttpJob.TotalTime.Secure.Quic", | 1480 UMA_HISTOGRAM_MEDIUM_TIMES("Net.HttpJob.TotalTime.Secure.Quic", |
| 1481 total_time); | 1481 total_time); |
| 1482 } else { | 1482 } else { |
| 1483 UMA_HISTOGRAM_MEDIUM_TIMES("Net.HttpJob.TotalTime.Secure.NotQuic", | 1483 UMA_HISTOGRAM_MEDIUM_TIMES("Net.HttpJob.TotalTime.Secure.NotQuic", |
| 1484 total_time); | 1484 total_time); |
| 1485 } | 1485 } |
| 1486 } | 1486 } |
| 1487 |
| 1488 UMA_HISTOGRAM_CUSTOM_COUNTS("Net.HttpJob.PrefilterBytesRead", |
| 1489 prefilter_bytes_read(), 1, 50000000, 50); |
| 1487 if (response_info_->was_cached) { | 1490 if (response_info_->was_cached) { |
| 1488 UMA_HISTOGRAM_TIMES("Net.HttpJob.TotalTimeCached", total_time); | 1491 UMA_HISTOGRAM_TIMES("Net.HttpJob.TotalTimeCached", total_time); |
| 1492 UMA_HISTOGRAM_CUSTOM_COUNTS("Net.HttpJob.PrefilterBytesRead.Cache", |
| 1493 prefilter_bytes_read(), 1, 50000000, 50); |
| 1494 |
| 1489 if (response_info_->unused_since_prefetch) | 1495 if (response_info_->unused_since_prefetch) |
| 1490 UMA_HISTOGRAM_COUNTS("Net.Prefetch.HitBytes", prefilter_bytes_read()); | 1496 UMA_HISTOGRAM_COUNTS("Net.Prefetch.HitBytes", prefilter_bytes_read()); |
| 1491 } else { | 1497 } else { |
| 1492 UMA_HISTOGRAM_TIMES("Net.HttpJob.TotalTimeNotCached", total_time); | 1498 UMA_HISTOGRAM_TIMES("Net.HttpJob.TotalTimeNotCached", total_time); |
| 1499 UMA_HISTOGRAM_CUSTOM_COUNTS("Net.HttpJob.PrefilterBytesRead.Net", |
| 1500 prefilter_bytes_read(), 1, 50000000, 50); |
| 1501 |
| 1502 if (request_info_.load_flags & LOAD_PREFETCH) { |
| 1503 UMA_HISTOGRAM_COUNTS("Net.Prefetch.PrefilterBytesReadFromNetwork", |
| 1504 prefilter_bytes_read()); |
| 1505 } |
| 1493 if (is_https_google) { | 1506 if (is_https_google) { |
| 1494 if (used_quic) { | 1507 if (used_quic) { |
| 1495 UMA_HISTOGRAM_MEDIUM_TIMES( | 1508 UMA_HISTOGRAM_MEDIUM_TIMES( |
| 1496 "Net.HttpJob.TotalTimeNotCached.Secure.Quic", total_time); | 1509 "Net.HttpJob.TotalTimeNotCached.Secure.Quic", total_time); |
| 1497 } else { | 1510 } else { |
| 1498 UMA_HISTOGRAM_MEDIUM_TIMES( | 1511 UMA_HISTOGRAM_MEDIUM_TIMES( |
| 1499 "Net.HttpJob.TotalTimeNotCached.Secure.NotQuic", total_time); | 1512 "Net.HttpJob.TotalTimeNotCached.Secure.NotQuic", total_time); |
| 1500 } | 1513 } |
| 1501 } | 1514 } |
| 1502 } | 1515 } |
| 1503 } | 1516 } |
| 1504 | 1517 |
| 1505 if (request_info_.load_flags & LOAD_PREFETCH && !request_->was_cached()) | |
| 1506 UMA_HISTOGRAM_COUNTS("Net.Prefetch.PrefilterBytesReadFromNetwork", | |
| 1507 prefilter_bytes_read()); | |
| 1508 | |
| 1509 start_time_ = base::TimeTicks(); | 1518 start_time_ = base::TimeTicks(); |
| 1510 } | 1519 } |
| 1511 | 1520 |
| 1512 void URLRequestHttpJob::DoneWithRequest(CompletionCause reason) { | 1521 void URLRequestHttpJob::DoneWithRequest(CompletionCause reason) { |
| 1513 if (done_) | 1522 if (done_) |
| 1514 return; | 1523 return; |
| 1515 done_ = true; | 1524 done_ = true; |
| 1516 | 1525 |
| 1517 // Notify NetworkQualityEstimator. | 1526 // Notify NetworkQualityEstimator. |
| 1518 NetworkQualityEstimator* network_quality_estimator = | 1527 NetworkQualityEstimator* network_quality_estimator = |
| (...skipping 19 matching lines...) Expand all Loading... |
| 1538 awaiting_callback_ = false; | 1547 awaiting_callback_ = false; |
| 1539 | 1548 |
| 1540 // Notify NetworkQualityEstimator. | 1549 // Notify NetworkQualityEstimator. |
| 1541 NetworkQualityEstimator* network_quality_estimator = | 1550 NetworkQualityEstimator* network_quality_estimator = |
| 1542 request()->context()->network_quality_estimator(); | 1551 request()->context()->network_quality_estimator(); |
| 1543 if (network_quality_estimator) | 1552 if (network_quality_estimator) |
| 1544 network_quality_estimator->NotifyURLRequestDestroyed(*request()); | 1553 network_quality_estimator->NotifyURLRequestDestroyed(*request()); |
| 1545 } | 1554 } |
| 1546 | 1555 |
| 1547 } // namespace net | 1556 } // namespace net |
| OLD | NEW |