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

Unified 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | net/log/net_log_event_type_list.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/loader/resource_dispatcher_host_impl.cc
diff --git a/content/browser/loader/resource_dispatcher_host_impl.cc b/content/browser/loader/resource_dispatcher_host_impl.cc
index e2bf1492e47e1b1d8807f68690ad91d13b7f5c37..90ed1ce30ae58f909973c8347dac8a4a9f14c956 100644
--- a/content/browser/loader/resource_dispatcher_host_impl.cc
+++ b/content/browser/loader/resource_dispatcher_host_impl.cc
@@ -102,6 +102,7 @@
#include "net/http/http_request_headers.h"
#include "net/http/http_response_headers.h"
#include "net/http/http_response_info.h"
+#include "net/log/net_log_with_source.h"
#include "net/ssl/client_cert_store.h"
#include "net/ssl/ssl_cert_request_info.h"
#include "net/url_request/url_request.h"
@@ -1227,6 +1228,15 @@ void ResourceDispatcherHostImpl::ContinuePendingBeginRequest(
: request_data.url,
request_data.priority, nullptr);
+ // Log that this request is a service worker navigation preload request here,
+ // since navigation preload machinery has no access to netlog.
+ // TODO(falken): Figure out how mojom::URLLoaderClient can
+ // access the request's netlog.
+ if (requester_info->IsNavigationPreload()) {
+ new_request->net_log().AddEvent(
+ net::NetLogEventType::SERVICE_WORKER_NAVIGATION_PRELOAD_REQUEST);
+ }
+
// PlzNavigate: Always set the method to GET when gaining access to the
// stream that contains the response body of a navigation. Otherwise the data
// that was already fetched by the browser will not be transmitted to the
« 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