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 "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/location.h" | 8 #include "base/location.h" |
9 #include "base/metrics/histogram.h" | 9 #include "base/metrics/histogram.h" |
10 #include "base/profiler/scoped_tracker.h" | 10 #include "base/profiler/scoped_tracker.h" |
11 #include "base/single_thread_task_runner.h" | 11 #include "base/single_thread_task_runner.h" |
12 #include "base/thread_task_runner_handle.h" | 12 #include "base/thread_task_runner_handle.h" |
13 #include "base/time/time.h" | 13 #include "base/time/time.h" |
14 #include "content/browser/appcache/appcache_interceptor.h" | 14 #include "content/browser/appcache/appcache_interceptor.h" |
15 #include "content/browser/child_process_security_policy_impl.h" | 15 #include "content/browser/child_process_security_policy_impl.h" |
16 #include "content/browser/loader/cross_site_resource_handler.h" | 16 #include "content/browser/loader/cross_site_resource_handler.h" |
17 #include "content/browser/loader/detachable_resource_handler.h" | 17 #include "content/browser/loader/detachable_resource_handler.h" |
18 #include "content/browser/loader/resource_loader_delegate.h" | 18 #include "content/browser/loader/resource_loader_delegate.h" |
19 #include "content/browser/loader/resource_request_info_impl.h" | 19 #include "content/browser/loader/resource_request_info_impl.h" |
20 #include "content/browser/service_worker/service_worker_request_handler.h" | 20 #include "content/browser/service_worker/service_worker_request_handler.h" |
21 #include "content/browser/ssl/ssl_client_auth_handler.h" | 21 #include "content/browser/ssl/ssl_client_auth_handler.h" |
22 #include "content/browser/ssl/ssl_manager.h" | 22 #include "content/browser/ssl/ssl_manager.h" |
23 #include "content/browser/ssl/ssl_policy.h" | 23 #include "content/browser/ssl/ssl_policy.h" |
| 24 #include "content/common/navigation_params.h" |
24 #include "content/common/ssl_status_serialization.h" | 25 #include "content/common/ssl_status_serialization.h" |
25 #include "content/public/browser/cert_store.h" | 26 #include "content/public/browser/cert_store.h" |
26 #include "content/public/browser/resource_context.h" | 27 #include "content/public/browser/resource_context.h" |
27 #include "content/public/browser/resource_dispatcher_host_login_delegate.h" | 28 #include "content/public/browser/resource_dispatcher_host_login_delegate.h" |
28 #include "content/public/browser/signed_certificate_timestamp_store.h" | 29 #include "content/public/browser/signed_certificate_timestamp_store.h" |
29 #include "content/public/common/content_client.h" | 30 #include "content/public/common/content_client.h" |
30 #include "content/public/common/content_switches.h" | 31 #include "content/public/common/content_switches.h" |
31 #include "content/public/common/process_type.h" | 32 #include "content/public/common/process_type.h" |
32 #include "content/public/common/resource_response.h" | 33 #include "content/public/common/resource_response.h" |
33 #include "content/public/common/security_style.h" | 34 #include "content/public/common/security_style.h" |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
87 request->GetMimeType(&response->head.mime_type); | 88 request->GetMimeType(&response->head.mime_type); |
88 net::HttpResponseInfo response_info = request->response_info(); | 89 net::HttpResponseInfo response_info = request->response_info(); |
89 response->head.was_fetched_via_spdy = response_info.was_fetched_via_spdy; | 90 response->head.was_fetched_via_spdy = response_info.was_fetched_via_spdy; |
90 response->head.was_npn_negotiated = response_info.was_npn_negotiated; | 91 response->head.was_npn_negotiated = response_info.was_npn_negotiated; |
91 response->head.npn_negotiated_protocol = | 92 response->head.npn_negotiated_protocol = |
92 response_info.npn_negotiated_protocol; | 93 response_info.npn_negotiated_protocol; |
93 response->head.connection_info = response_info.connection_info; | 94 response->head.connection_info = response_info.connection_info; |
94 response->head.was_fetched_via_proxy = request->was_fetched_via_proxy(); | 95 response->head.was_fetched_via_proxy = request->was_fetched_via_proxy(); |
95 response->head.proxy_server = response_info.proxy_server; | 96 response->head.proxy_server = response_info.proxy_server; |
96 response->head.socket_address = request->GetSocketAddress(); | 97 response->head.socket_address = request->GetSocketAddress(); |
| 98 const content::ResourceRequestInfo* request_info = |
| 99 content::ResourceRequestInfo::ForRequest(request); |
| 100 if (request_info) |
| 101 response->head.is_lofi = request_info->IsLoFi(); |
97 if (ServiceWorkerRequestHandler* handler = | 102 if (ServiceWorkerRequestHandler* handler = |
98 ServiceWorkerRequestHandler::GetHandler(request)) { | 103 ServiceWorkerRequestHandler::GetHandler(request)) { |
99 handler->GetExtraResponseInfo(&response->head); | 104 handler->GetExtraResponseInfo(&response->head); |
100 } | 105 } |
101 AppCacheInterceptor::GetExtraResponseInfo( | 106 AppCacheInterceptor::GetExtraResponseInfo( |
102 request, &response->head.appcache_id, | 107 request, &response->head.appcache_id, |
103 &response->head.appcache_manifest_url); | 108 &response->head.appcache_manifest_url); |
104 if (info->is_load_timing_enabled()) | 109 if (info->is_load_timing_enabled()) |
105 request->GetLoadTimingInfo(&response->head.load_timing); | 110 request->GetLoadTimingInfo(&response->head.load_timing); |
106 | 111 |
(...skipping 590 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
697 case net::URLRequestStatus::FAILED: | 702 case net::URLRequestStatus::FAILED: |
698 status = STATUS_UNDEFINED; | 703 status = STATUS_UNDEFINED; |
699 break; | 704 break; |
700 } | 705 } |
701 | 706 |
702 UMA_HISTOGRAM_ENUMERATION("Net.Prefetch.Pattern", status, STATUS_MAX); | 707 UMA_HISTOGRAM_ENUMERATION("Net.Prefetch.Pattern", status, STATUS_MAX); |
703 } | 708 } |
704 } | 709 } |
705 | 710 |
706 } // namespace content | 711 } // namespace content |
OLD | NEW |