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

Unified Diff: content/browser/loader/resource_request_info_impl.h

Issue 2399063002: PlzNavigate: make ServiceWorker ForeignFetch work (Closed)
Patch Set: Addressed comment Created 4 years, 2 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
Index: content/browser/loader/resource_request_info_impl.h
diff --git a/content/browser/loader/resource_request_info_impl.h b/content/browser/loader/resource_request_info_impl.h
index 356efa4cf8a0bf1d52944c9f15393d0a551f72ee..8026a97678fdd8883f614f776618bffe82238e6d 100644
--- a/content/browser/loader/resource_request_info_impl.h
+++ b/content/browser/loader/resource_request_info_impl.h
@@ -13,6 +13,7 @@
#include "base/memory/ref_counted.h"
#include "base/memory/weak_ptr.h"
#include "base/supports_user_data.h"
+#include "content/browser/service_worker/service_worker_context_wrapper.h"
#include "content/common/resource_request_body_impl.h"
#include "content/public/browser/navigation_ui_data.h"
#include "content/public/browser/resource_request_info.h"
@@ -205,6 +206,17 @@ class ResourceRequestInfoImpl : public ResourceRequestInfo,
navigation_ui_data_ = std::move(navigation_ui_data);
}
+ // PlzNavigate: used in navigations to store the ServiceWorkerContext, since
+ // the ResourceMessageFilter will be null in this case. All other requests
+ // should access the ServiceWorkerContext through the ResourceMessageFilter.
+ void set_service_worker_context(
+ scoped_refptr<ServiceWorkerContextWrapper> service_worker_context) {
+ service_worker_context_ = service_worker_context;
+ }
+ ServiceWorkerContextWrapper* service_worker_context() const {
+ return service_worker_context_.get();
+ }
+
private:
FRIEND_TEST_ALL_PREFIXES(ResourceDispatcherHostTest,
DeletedFilterDetached);
@@ -249,6 +261,7 @@ class ResourceRequestInfoImpl : public ResourceRequestInfo,
scoped_refptr<ResourceRequestBodyImpl> body_;
bool initiated_in_secure_context_;
std::unique_ptr<NavigationUIData> navigation_ui_data_;
+ scoped_refptr<ServiceWorkerContextWrapper> service_worker_context_;
DISALLOW_COPY_AND_ASSIGN(ResourceRequestInfoImpl);
};
« no previous file with comments | « content/browser/loader/resource_dispatcher_host_impl.cc ('k') | content/browser/service_worker/link_header_support.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698