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" |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
87 request->GetMimeType(&response->head.mime_type); | 87 request->GetMimeType(&response->head.mime_type); |
88 net::HttpResponseInfo response_info = request->response_info(); | 88 net::HttpResponseInfo response_info = request->response_info(); |
89 response->head.was_fetched_via_spdy = response_info.was_fetched_via_spdy; | 89 response->head.was_fetched_via_spdy = response_info.was_fetched_via_spdy; |
90 response->head.was_npn_negotiated = response_info.was_npn_negotiated; | 90 response->head.was_npn_negotiated = response_info.was_npn_negotiated; |
91 response->head.npn_negotiated_protocol = | 91 response->head.npn_negotiated_protocol = |
92 response_info.npn_negotiated_protocol; | 92 response_info.npn_negotiated_protocol; |
93 response->head.connection_info = response_info.connection_info; | 93 response->head.connection_info = response_info.connection_info; |
94 response->head.was_fetched_via_proxy = request->was_fetched_via_proxy(); | 94 response->head.was_fetched_via_proxy = request->was_fetched_via_proxy(); |
95 response->head.proxy_server = response_info.proxy_server; | 95 response->head.proxy_server = response_info.proxy_server; |
96 response->head.socket_address = request->GetSocketAddress(); | 96 response->head.socket_address = request->GetSocketAddress(); |
| 97 const content::ResourceRequestInfo* request_info = |
| 98 content::ResourceRequestInfo::ForRequest(request); |
| 99 if (request_info) |
| 100 response->head.is_using_lofi = request_info->IsUsingLoFi(); |
97 if (ServiceWorkerRequestHandler* handler = | 101 if (ServiceWorkerRequestHandler* handler = |
98 ServiceWorkerRequestHandler::GetHandler(request)) { | 102 ServiceWorkerRequestHandler::GetHandler(request)) { |
99 handler->GetExtraResponseInfo(&response->head); | 103 handler->GetExtraResponseInfo(&response->head); |
100 } | 104 } |
101 AppCacheInterceptor::GetExtraResponseInfo( | 105 AppCacheInterceptor::GetExtraResponseInfo( |
102 request, &response->head.appcache_id, | 106 request, &response->head.appcache_id, |
103 &response->head.appcache_manifest_url); | 107 &response->head.appcache_manifest_url); |
104 if (info->is_load_timing_enabled()) | 108 if (info->is_load_timing_enabled()) |
105 request->GetLoadTimingInfo(&response->head.load_timing); | 109 request->GetLoadTimingInfo(&response->head.load_timing); |
106 | 110 |
(...skipping 590 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
697 case net::URLRequestStatus::FAILED: | 701 case net::URLRequestStatus::FAILED: |
698 status = STATUS_UNDEFINED; | 702 status = STATUS_UNDEFINED; |
699 break; | 703 break; |
700 } | 704 } |
701 | 705 |
702 UMA_HISTOGRAM_ENUMERATION("Net.Prefetch.Pattern", status, STATUS_MAX); | 706 UMA_HISTOGRAM_ENUMERATION("Net.Prefetch.Pattern", status, STATUS_MAX); |
703 } | 707 } |
704 } | 708 } |
705 | 709 |
706 } // namespace content | 710 } // namespace content |
OLD | NEW |