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 18 matching lines...) Expand all Loading... |
29 #include "content/public/browser/cert_store.h" | 29 #include "content/public/browser/cert_store.h" |
30 #include "content/public/browser/resource_dispatcher_host_login_delegate.h" | 30 #include "content/public/browser/resource_dispatcher_host_login_delegate.h" |
31 #include "content/public/common/content_client.h" | 31 #include "content/public/common/content_client.h" |
32 #include "content/public/common/content_switches.h" | 32 #include "content/public/common/content_switches.h" |
33 #include "content/public/common/process_type.h" | 33 #include "content/public/common/process_type.h" |
34 #include "content/public/common/resource_response.h" | 34 #include "content/public/common/resource_response.h" |
35 #include "content/public/common/security_style.h" | 35 #include "content/public/common/security_style.h" |
36 #include "net/base/io_buffer.h" | 36 #include "net/base/io_buffer.h" |
37 #include "net/base/load_flags.h" | 37 #include "net/base/load_flags.h" |
38 #include "net/http/http_response_headers.h" | 38 #include "net/http/http_response_headers.h" |
| 39 #include "net/nqe/effective_connection_type.h" |
39 #include "net/nqe/network_quality_estimator.h" | 40 #include "net/nqe/network_quality_estimator.h" |
40 #include "net/ssl/client_cert_store.h" | 41 #include "net/ssl/client_cert_store.h" |
41 #include "net/ssl/ssl_platform_key.h" | 42 #include "net/ssl/ssl_platform_key.h" |
42 #include "net/ssl/ssl_private_key.h" | 43 #include "net/ssl/ssl_private_key.h" |
43 #include "net/url_request/redirect_info.h" | 44 #include "net/url_request/redirect_info.h" |
44 #include "net/url_request/url_request_context.h" | 45 #include "net/url_request/url_request_context.h" |
45 #include "net/url_request/url_request_status.h" | 46 #include "net/url_request/url_request_status.h" |
46 | 47 |
47 using base::TimeDelta; | 48 using base::TimeDelta; |
48 using base::TimeTicks; | 49 using base::TimeTicks; |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
81 response->head.connection_info = response_info.connection_info; | 82 response->head.connection_info = response_info.connection_info; |
82 response->head.was_fetched_via_proxy = request->was_fetched_via_proxy(); | 83 response->head.was_fetched_via_proxy = request->was_fetched_via_proxy(); |
83 response->head.proxy_server = response_info.proxy_server; | 84 response->head.proxy_server = response_info.proxy_server; |
84 response->head.socket_address = response_info.socket_address; | 85 response->head.socket_address = response_info.socket_address; |
85 const content::ResourceRequestInfo* request_info = | 86 const content::ResourceRequestInfo* request_info = |
86 content::ResourceRequestInfo::ForRequest(request); | 87 content::ResourceRequestInfo::ForRequest(request); |
87 if (request_info) | 88 if (request_info) |
88 response->head.is_using_lofi = request_info->IsUsingLoFi(); | 89 response->head.is_using_lofi = request_info->IsUsingLoFi(); |
89 | 90 |
90 response->head.effective_connection_type = | 91 response->head.effective_connection_type = |
91 net::NetworkQualityEstimator::EFFECTIVE_CONNECTION_TYPE_UNKNOWN; | 92 net::EFFECTIVE_CONNECTION_TYPE_UNKNOWN; |
92 if (info->IsMainFrame()) { | 93 if (info->IsMainFrame()) { |
93 net::NetworkQualityEstimator* estimator = | 94 net::NetworkQualityEstimator* estimator = |
94 request->context()->network_quality_estimator(); | 95 request->context()->network_quality_estimator(); |
95 if (estimator) { | 96 if (estimator) { |
96 response->head.effective_connection_type = | 97 response->head.effective_connection_type = |
97 estimator->GetEffectiveConnectionType(); | 98 estimator->GetEffectiveConnectionType(); |
98 } | 99 } |
99 } | 100 } |
100 | 101 |
101 const ServiceWorkerResponseInfo* service_worker_info = | 102 const ServiceWorkerResponseInfo* service_worker_info = |
(...skipping 633 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
735 } | 736 } |
736 | 737 |
737 UMA_HISTOGRAM_ENUMERATION("Net.Prefetch.Pattern", status, STATUS_MAX); | 738 UMA_HISTOGRAM_ENUMERATION("Net.Prefetch.Pattern", status, STATUS_MAX); |
738 } else if (request_->response_info().unused_since_prefetch) { | 739 } else if (request_->response_info().unused_since_prefetch) { |
739 TimeDelta total_time = base::TimeTicks::Now() - request_->creation_time(); | 740 TimeDelta total_time = base::TimeTicks::Now() - request_->creation_time(); |
740 UMA_HISTOGRAM_TIMES("Net.Prefetch.TimeSpentOnPrefetchHit", total_time); | 741 UMA_HISTOGRAM_TIMES("Net.Prefetch.TimeSpentOnPrefetchHit", total_time); |
741 } | 742 } |
742 } | 743 } |
743 | 744 |
744 } // namespace content | 745 } // namespace content |
OLD | NEW |