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 "content/browser/loader/resource_loader.h" | 5 #include "content/browser/loader/resource_loader.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/location.h" | 10 #include "base/location.h" |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 83 response->head.was_fetched_via_proxy = request->was_fetched_via_proxy(); | 83 response->head.was_fetched_via_proxy = request->was_fetched_via_proxy(); |
| 84 response->head.proxy_server = response_info.proxy_server; | 84 response->head.proxy_server = response_info.proxy_server; |
| 85 response->head.socket_address = response_info.socket_address; | 85 response->head.socket_address = response_info.socket_address; |
| 86 const content::ResourceRequestInfo* request_info = | 86 const content::ResourceRequestInfo* request_info = |
| 87 content::ResourceRequestInfo::ForRequest(request); | 87 content::ResourceRequestInfo::ForRequest(request); |
| 88 if (request_info) | 88 if (request_info) |
| 89 response->head.is_using_lofi = request_info->IsUsingLoFi(); | 89 response->head.is_using_lofi = request_info->IsUsingLoFi(); |
| 90 | 90 |
| 91 response->head.effective_connection_type = | 91 response->head.effective_connection_type = |
| 92 net::EFFECTIVE_CONNECTION_TYPE_UNKNOWN; | 92 net::EFFECTIVE_CONNECTION_TYPE_UNKNOWN; |
| 93 if (info->IsMainFrame()) { | 93 |
| 94 if (info->IsMainFrame() && | |
|
RyanSturm
2016/08/08 18:13:37
Is the info->IsMainFrame() part of this necessary?
tbansal1
2016/08/08 18:35:25
Done.
| |
| 95 (info->GetResourceType() == RESOURCE_TYPE_MAIN_FRAME)) { | |
|
RyanSturm
2016/08/08 18:13:37
#include "content/public/common/resource_type.h"
tbansal1
2016/08/08 18:35:25
Done.
| |
| 94 net::NetworkQualityEstimator* estimator = | 96 net::NetworkQualityEstimator* estimator = |
| 95 request->context()->network_quality_estimator(); | 97 request->context()->network_quality_estimator(); |
| 96 if (estimator) { | 98 if (estimator) { |
| 97 response->head.effective_connection_type = | 99 response->head.effective_connection_type = |
| 98 estimator->GetEffectiveConnectionType(); | 100 estimator->GetEffectiveConnectionType(); |
| 99 } | 101 } |
| 100 } | 102 } |
| 101 | 103 |
| 102 const ServiceWorkerResponseInfo* service_worker_info = | 104 const ServiceWorkerResponseInfo* service_worker_info = |
| 103 ServiceWorkerResponseInfo::ForRequest(request); | 105 ServiceWorkerResponseInfo::ForRequest(request); |
| (...skipping 632 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 736 } | 738 } |
| 737 | 739 |
| 738 UMA_HISTOGRAM_ENUMERATION("Net.Prefetch.Pattern", status, STATUS_MAX); | 740 UMA_HISTOGRAM_ENUMERATION("Net.Prefetch.Pattern", status, STATUS_MAX); |
| 739 } else if (request_->response_info().unused_since_prefetch) { | 741 } else if (request_->response_info().unused_since_prefetch) { |
| 740 TimeDelta total_time = base::TimeTicks::Now() - request_->creation_time(); | 742 TimeDelta total_time = base::TimeTicks::Now() - request_->creation_time(); |
| 741 UMA_HISTOGRAM_TIMES("Net.Prefetch.TimeSpentOnPrefetchHit", total_time); | 743 UMA_HISTOGRAM_TIMES("Net.Prefetch.TimeSpentOnPrefetchHit", total_time); |
| 742 } | 744 } |
| 743 } | 745 } |
| 744 | 746 |
| 745 } // namespace content | 747 } // namespace content |
| OLD | NEW |