Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(215)

Side by Side Diff: content/browser/loader/resource_loader.cc

Issue 1867293004: Set service worker response info data for foreign fetch intercepted fetches. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@ff-check-origin
Patch Set: address comment Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | content/browser/service_worker/foreign_fetch_request_handler.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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"
11 #include "base/metrics/histogram.h" 11 #include "base/metrics/histogram.h"
12 #include "base/profiler/scoped_tracker.h" 12 #include "base/profiler/scoped_tracker.h"
13 #include "base/single_thread_task_runner.h" 13 #include "base/single_thread_task_runner.h"
14 #include "base/thread_task_runner_handle.h" 14 #include "base/thread_task_runner_handle.h"
15 #include "base/time/time.h" 15 #include "base/time/time.h"
16 #include "base/trace_event/trace_event.h" 16 #include "base/trace_event/trace_event.h"
17 #include "content/browser/appcache/appcache_interceptor.h" 17 #include "content/browser/appcache/appcache_interceptor.h"
18 #include "content/browser/child_process_security_policy_impl.h" 18 #include "content/browser/child_process_security_policy_impl.h"
19 #include "content/browser/loader/cross_site_resource_handler.h" 19 #include "content/browser/loader/cross_site_resource_handler.h"
20 #include "content/browser/loader/detachable_resource_handler.h" 20 #include "content/browser/loader/detachable_resource_handler.h"
21 #include "content/browser/loader/resource_loader_delegate.h" 21 #include "content/browser/loader/resource_loader_delegate.h"
22 #include "content/browser/loader/resource_request_info_impl.h" 22 #include "content/browser/loader/resource_request_info_impl.h"
23 #include "content/browser/service_worker/service_worker_request_handler.h" 23 #include "content/browser/service_worker/service_worker_request_handler.h"
24 #include "content/browser/service_worker/service_worker_response_info.h"
24 #include "content/browser/ssl/ssl_client_auth_handler.h" 25 #include "content/browser/ssl/ssl_client_auth_handler.h"
25 #include "content/browser/ssl/ssl_manager.h" 26 #include "content/browser/ssl/ssl_manager.h"
26 #include "content/browser/ssl/ssl_policy.h" 27 #include "content/browser/ssl/ssl_policy.h"
27 #include "content/common/ssl_status_serialization.h" 28 #include "content/common/ssl_status_serialization.h"
28 #include "content/public/browser/cert_store.h" 29 #include "content/public/browser/cert_store.h"
29 #include "content/public/browser/resource_context.h" 30 #include "content/public/browser/resource_context.h"
30 #include "content/public/browser/resource_dispatcher_host_login_delegate.h" 31 #include "content/public/browser/resource_dispatcher_host_login_delegate.h"
31 #include "content/public/browser/signed_certificate_timestamp_store.h" 32 #include "content/public/browser/signed_certificate_timestamp_store.h"
32 #include "content/public/common/content_client.h" 33 #include "content/public/common/content_client.h"
33 #include "content/public/common/content_switches.h" 34 #include "content/public/common/content_switches.h"
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
96 response->head.npn_negotiated_protocol = 97 response->head.npn_negotiated_protocol =
97 response_info.npn_negotiated_protocol; 98 response_info.npn_negotiated_protocol;
98 response->head.connection_info = response_info.connection_info; 99 response->head.connection_info = response_info.connection_info;
99 response->head.was_fetched_via_proxy = request->was_fetched_via_proxy(); 100 response->head.was_fetched_via_proxy = request->was_fetched_via_proxy();
100 response->head.proxy_server = response_info.proxy_server; 101 response->head.proxy_server = response_info.proxy_server;
101 response->head.socket_address = request->GetSocketAddress(); 102 response->head.socket_address = request->GetSocketAddress();
102 const content::ResourceRequestInfo* request_info = 103 const content::ResourceRequestInfo* request_info =
103 content::ResourceRequestInfo::ForRequest(request); 104 content::ResourceRequestInfo::ForRequest(request);
104 if (request_info) 105 if (request_info)
105 response->head.is_using_lofi = request_info->IsUsingLoFi(); 106 response->head.is_using_lofi = request_info->IsUsingLoFi();
106 if (ServiceWorkerRequestHandler* handler = 107 const ServiceWorkerResponseInfo* service_worker_info =
107 ServiceWorkerRequestHandler::GetHandler(request)) { 108 ServiceWorkerResponseInfo::ForRequest(request);
108 handler->GetExtraResponseInfo(&response->head); 109 if (service_worker_info)
109 } 110 service_worker_info->GetExtraResponseInfo(&response->head);
110 AppCacheInterceptor::GetExtraResponseInfo( 111 AppCacheInterceptor::GetExtraResponseInfo(
111 request, &response->head.appcache_id, 112 request, &response->head.appcache_id,
112 &response->head.appcache_manifest_url); 113 &response->head.appcache_manifest_url);
113 if (info->is_load_timing_enabled()) 114 if (info->is_load_timing_enabled())
114 request->GetLoadTimingInfo(&response->head.load_timing); 115 request->GetLoadTimingInfo(&response->head.load_timing);
115 116
116 if (request->ssl_info().cert.get()) { 117 if (request->ssl_info().cert.get()) {
117 SSLStatus ssl_status; 118 SSLStatus ssl_status;
118 GetSSLStatusForRequest(request->url(), request->ssl_info(), 119 GetSSLStatusForRequest(request->url(), request->ssl_info(),
119 info->GetChildID(), cert_store, &ssl_status); 120 info->GetChildID(), cert_store, &ssl_status);
(...skipping 620 matching lines...) Expand 10 before | Expand all | Expand 10 after
740 case net::URLRequestStatus::FAILED: 741 case net::URLRequestStatus::FAILED:
741 status = STATUS_UNDEFINED; 742 status = STATUS_UNDEFINED;
742 break; 743 break;
743 } 744 }
744 745
745 UMA_HISTOGRAM_ENUMERATION("Net.Prefetch.Pattern", status, STATUS_MAX); 746 UMA_HISTOGRAM_ENUMERATION("Net.Prefetch.Pattern", status, STATUS_MAX);
746 } 747 }
747 } 748 }
748 749
749 } // namespace content 750 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | content/browser/service_worker/foreign_fetch_request_handler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698