| 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/callback_helpers.h" | 9 #include "base/callback_helpers.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 net::HttpResponseInfo response_info = request->response_info(); | 60 net::HttpResponseInfo response_info = request->response_info(); |
| 61 response->head.was_fetched_via_spdy = response_info.was_fetched_via_spdy; | 61 response->head.was_fetched_via_spdy = response_info.was_fetched_via_spdy; |
| 62 response->head.was_alpn_negotiated = response_info.was_alpn_negotiated; | 62 response->head.was_alpn_negotiated = response_info.was_alpn_negotiated; |
| 63 response->head.alpn_negotiated_protocol = | 63 response->head.alpn_negotiated_protocol = |
| 64 response_info.alpn_negotiated_protocol; | 64 response_info.alpn_negotiated_protocol; |
| 65 response->head.connection_info = response_info.connection_info; | 65 response->head.connection_info = response_info.connection_info; |
| 66 response->head.socket_address = response_info.socket_address; | 66 response->head.socket_address = response_info.socket_address; |
| 67 const content::ResourceRequestInfo* request_info = | 67 const content::ResourceRequestInfo* request_info = |
| 68 content::ResourceRequestInfo::ForRequest(request); | 68 content::ResourceRequestInfo::ForRequest(request); |
| 69 if (request_info) | 69 if (request_info) |
| 70 response->head.is_using_lofi = request_info->IsUsingLoFi(); | 70 response->head.previews_state = request_info->GetPreviewsState(); |
| 71 | 71 |
| 72 response->head.effective_connection_type = | 72 response->head.effective_connection_type = |
| 73 net::EFFECTIVE_CONNECTION_TYPE_UNKNOWN; | 73 net::EFFECTIVE_CONNECTION_TYPE_UNKNOWN; |
| 74 | 74 |
| 75 if (info->GetResourceType() == RESOURCE_TYPE_MAIN_FRAME) { | 75 if (info->GetResourceType() == RESOURCE_TYPE_MAIN_FRAME) { |
| 76 DCHECK(info->IsMainFrame()); | 76 DCHECK(info->IsMainFrame()); |
| 77 net::NetworkQualityEstimator* estimator = | 77 net::NetworkQualityEstimator* estimator = |
| 78 request->context()->network_quality_estimator(); | 78 request->context()->network_quality_estimator(); |
| 79 if (estimator) { | 79 if (estimator) { |
| 80 response->head.effective_connection_type = | 80 response->head.effective_connection_type = |
| (...skipping 656 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 737 UMA_HISTOGRAM_ENUMERATION("Net.Prefetch.Pattern", prefetch_status, | 737 UMA_HISTOGRAM_ENUMERATION("Net.Prefetch.Pattern", prefetch_status, |
| 738 STATUS_MAX); | 738 STATUS_MAX); |
| 739 } | 739 } |
| 740 } else if (request_->response_info().unused_since_prefetch) { | 740 } else if (request_->response_info().unused_since_prefetch) { |
| 741 TimeDelta total_time = base::TimeTicks::Now() - request_->creation_time(); | 741 TimeDelta total_time = base::TimeTicks::Now() - request_->creation_time(); |
| 742 UMA_HISTOGRAM_TIMES("Net.Prefetch.TimeSpentOnPrefetchHit", total_time); | 742 UMA_HISTOGRAM_TIMES("Net.Prefetch.TimeSpentOnPrefetchHit", total_time); |
| 743 } | 743 } |
| 744 } | 744 } |
| 745 | 745 |
| 746 } // namespace content | 746 } // namespace content |
| OLD | NEW |