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

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

Issue 2818543005: service worker: Add a netlog event for navigation preload (Closed)
Patch Set: Created 3 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 | net/log/net_log_event_type_list.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 // See http://dev.chromium.org/developers/design-documents/multi-process-resourc e-loading 5 // See http://dev.chromium.org/developers/design-documents/multi-process-resourc e-loading
6 6
7 #include "content/browser/loader/resource_dispatcher_host_impl.h" 7 #include "content/browser/loader/resource_dispatcher_host_impl.h"
8 8
9 #include <stddef.h> 9 #include <stddef.h>
10 10
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
95 #include "net/base/load_flags.h" 95 #include "net/base/load_flags.h"
96 #include "net/base/mime_util.h" 96 #include "net/base/mime_util.h"
97 #include "net/base/net_errors.h" 97 #include "net/base/net_errors.h"
98 #include "net/base/registry_controlled_domains/registry_controlled_domain.h" 98 #include "net/base/registry_controlled_domains/registry_controlled_domain.h"
99 #include "net/base/upload_data_stream.h" 99 #include "net/base/upload_data_stream.h"
100 #include "net/cert/cert_status_flags.h" 100 #include "net/cert/cert_status_flags.h"
101 #include "net/cookies/cookie_monster.h" 101 #include "net/cookies/cookie_monster.h"
102 #include "net/http/http_request_headers.h" 102 #include "net/http/http_request_headers.h"
103 #include "net/http/http_response_headers.h" 103 #include "net/http/http_response_headers.h"
104 #include "net/http/http_response_info.h" 104 #include "net/http/http_response_info.h"
105 #include "net/log/net_log_with_source.h"
105 #include "net/ssl/client_cert_store.h" 106 #include "net/ssl/client_cert_store.h"
106 #include "net/ssl/ssl_cert_request_info.h" 107 #include "net/ssl/ssl_cert_request_info.h"
107 #include "net/url_request/url_request.h" 108 #include "net/url_request/url_request.h"
108 #include "net/url_request/url_request_context.h" 109 #include "net/url_request/url_request_context.h"
109 #include "net/url_request/url_request_job_factory.h" 110 #include "net/url_request/url_request_job_factory.h"
110 #include "ppapi/features/features.h" 111 #include "ppapi/features/features.h"
111 #include "storage/browser/blob/blob_data_handle.h" 112 #include "storage/browser/blob/blob_data_handle.h"
112 #include "storage/browser/blob/blob_storage_context.h" 113 #include "storage/browser/blob/blob_storage_context.h"
113 #include "storage/browser/blob/blob_url_request_job_factory.h" 114 #include "storage/browser/blob/blob_url_request_job_factory.h"
114 #include "storage/browser/blob/shareable_file_reference.h" 115 #include "storage/browser/blob/shareable_file_reference.h"
(...skipping 1105 matching lines...) Expand 10 before | Expand all | Expand 10 after
1220 request_id, std::move(url_loader_client)); 1221 request_id, std::move(url_loader_client));
1221 return; 1222 return;
1222 } 1223 }
1223 1224
1224 // Construct the request. 1225 // Construct the request.
1225 std::unique_ptr<net::URLRequest> new_request = request_context->CreateRequest( 1226 std::unique_ptr<net::URLRequest> new_request = request_context->CreateRequest(
1226 is_navigation_stream_request ? request_data.resource_body_stream_url 1227 is_navigation_stream_request ? request_data.resource_body_stream_url
1227 : request_data.url, 1228 : request_data.url,
1228 request_data.priority, nullptr); 1229 request_data.priority, nullptr);
1229 1230
1231 // Log that this request is a service worker navigation preload request here,
1232 // since navigation preload machinery has no access to netlog.
1233 // TODO(falken): Figure out how mojom::URLLoaderClient can
1234 // access the request's netlog.
1235 if (requester_info->IsNavigationPreload()) {
1236 new_request->net_log().AddEvent(
1237 net::NetLogEventType::SERVICE_WORKER_NAVIGATION_PRELOAD_REQUEST);
1238 }
1239
1230 // PlzNavigate: Always set the method to GET when gaining access to the 1240 // PlzNavigate: Always set the method to GET when gaining access to the
1231 // stream that contains the response body of a navigation. Otherwise the data 1241 // stream that contains the response body of a navigation. Otherwise the data
1232 // that was already fetched by the browser will not be transmitted to the 1242 // that was already fetched by the browser will not be transmitted to the
1233 // renderer. 1243 // renderer.
1234 if (is_navigation_stream_request) 1244 if (is_navigation_stream_request)
1235 new_request->set_method("GET"); 1245 new_request->set_method("GET");
1236 else 1246 else
1237 new_request->set_method(request_data.method); 1247 new_request->set_method(request_data.method);
1238 1248
1239 new_request->set_first_party_for_cookies( 1249 new_request->set_first_party_for_cookies(
(...skipping 1377 matching lines...) Expand 10 before | Expand all | Expand 10 after
2617 &throttles); 2627 &throttles);
2618 if (!throttles.empty()) { 2628 if (!throttles.empty()) {
2619 handler.reset(new ThrottlingResourceHandler(std::move(handler), request, 2629 handler.reset(new ThrottlingResourceHandler(std::move(handler), request,
2620 std::move(throttles))); 2630 std::move(throttles)));
2621 } 2631 }
2622 } 2632 }
2623 return handler; 2633 return handler;
2624 } 2634 }
2625 2635
2626 } // namespace content 2636 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | net/log/net_log_event_type_list.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698