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/service_worker/service_worker_navigation_handle_core.cc

Issue 2460223003: Support Service Worker NavigationPreload with PlzNavigate. (Closed)
Patch Set: fix windows compile error Created 4 years, 1 month 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
Index: content/browser/service_worker/service_worker_navigation_handle_core.cc
diff --git a/content/browser/service_worker/service_worker_navigation_handle_core.cc b/content/browser/service_worker/service_worker_navigation_handle_core.cc
index 279461f8e8f06d4d49240f3ee8cc714eeb9dd099..eee92d146b8033e4a9acd7af90792daab00bec97 100644
--- a/content/browser/service_worker/service_worker_navigation_handle_core.cc
+++ b/content/browser/service_worker/service_worker_navigation_handle_core.cc
@@ -7,6 +7,7 @@
#include <utility>
#include "base/bind.h"
+#include "content/browser/loader/resource_message_filter.h"
#include "content/browser/service_worker/service_worker_context_core.h"
#include "content/browser/service_worker/service_worker_context_wrapper.h"
#include "content/browser/service_worker/service_worker_navigation_handle.h"
@@ -18,8 +19,11 @@ namespace content {
ServiceWorkerNavigationHandleCore::ServiceWorkerNavigationHandleCore(
base::WeakPtr<ServiceWorkerNavigationHandle> ui_handle,
- ServiceWorkerContextWrapper* context_wrapper)
- : context_wrapper_(context_wrapper), ui_handle_(ui_handle) {
+ ServiceWorkerContextWrapper* context_wrapper,
+ ResourceMessageFilter* resource_message_filter)
+ : context_wrapper_(context_wrapper),
+ resource_message_filter_(resource_message_filter),
+ ui_handle_(ui_handle) {
// The ServiceWorkerNavigationHandleCore is created on the UI thread but
// should only be accessed from the IO thread afterwards.
DCHECK_CURRENTLY_ON(BrowserThread::UI);
@@ -40,6 +44,8 @@ void ServiceWorkerNavigationHandleCore::DidPreCreateProviderHost(
DCHECK(context_wrapper_->context());
precreated_host_ = std::move(precreated_host);
+ precreated_host_->set_resource_filter_for_navigation_preload(
+ std::move(resource_message_filter_));
context_wrapper_->context()->AddNavigationHandleCore(
precreated_host_->provider_id(), this);
BrowserThread::PostTask(

Powered by Google App Engine
This is Rietveld 408576698