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

Unified Diff: content/browser/service_worker/service_worker_request_handler.h

Issue 2886843006: servificied service worker interception
Patch Set: Created 3 years, 7 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/service_worker/service_worker_request_handler.h
diff --git a/content/browser/service_worker/service_worker_request_handler.h b/content/browser/service_worker/service_worker_request_handler.h
index 98d245692c3eda87e8c01eed851ac42e065b750b..8af1eff3739a5b79aecf500695d1643dc421907d 100644
--- a/content/browser/service_worker/service_worker_request_handler.h
+++ b/content/browser/service_worker/service_worker_request_handler.h
@@ -34,6 +34,7 @@ class BlobStorageContext;
namespace content {
class ResourceContext;
+struct ResourceRequest;
class ResourceRequestBodyImpl;
class ServiceWorkerContextCore;
class ServiceWorkerContextWrapper;
@@ -50,7 +51,7 @@ class CONTENT_EXPORT ServiceWorkerRequestHandler
// Attaches a newly created handler if the given |request| needs to be handled
// by ServiceWorker.
static void InitializeForNavigation(
- net::URLRequest* request,
+ net::URLRequest* url_request,
ServiceWorkerNavigationHandleCore* navigation_handle_core,
storage::BlobStorageContext* blob_storage_context,
bool skip_service_worker,
@@ -63,7 +64,7 @@ class CONTENT_EXPORT ServiceWorkerRequestHandler
// PlzNavigate and --enable-network-service.
// Same as InitializeForNavigation() but instead of attaching to a URLRequest,
- // returns a URLLoaderFactoryPtrInfo if the request needs to be handled.
+ // TODO(falken): is comment wrong?
static mojom::URLLoaderFactoryPtr InitializeForNavigationNetworkService(
const ResourceRequest& resource_request,
ResourceContext* resource_context,
@@ -75,6 +76,10 @@ class CONTENT_EXPORT ServiceWorkerRequestHandler
RequestContextFrameType frame_type,
bool is_parent_frame_secure,
scoped_refptr<ResourceRequestBodyImpl> body,
+#if 0
+ const base::Callback<WebContents*(void)>& web_contents_getter,
+ NetworkFallbackCallback network_fallback_callback);
+#endif
const base::Callback<WebContents*(void)>& web_contents_getter);
// Attaches a newly created handler if the given |request| needs to
@@ -126,6 +131,11 @@ class CONTENT_EXPORT ServiceWorkerRequestHandler
net::NetworkDelegate* network_delegate,
ResourceContext* context) = 0;
+ virtual mojom::URLLoaderFactoryPtr MaybeGetURLLoaderFactory(
+ const ResourceRequest& resource_request,
+ ResourceContext* resource_context,
+ std::unique_ptr<ServiceWorkerRequestHandler> request_handler);
+
// Methods to support cross site navigations.
void PrepareForCrossSiteTransfer(int old_process_id);
void CompleteCrossSiteTransfer(int new_process_id,
@@ -150,6 +160,23 @@ class CONTENT_EXPORT ServiceWorkerRequestHandler
ResourceType resource_type_;
private:
+ static std::unique_ptr<ServiceWorkerRequestHandler>
+ InitializeForNavigationInternal(
+ const GURL& url,
+ ServiceWorkerNavigationHandleCore* navigation_handle_core,
+ storage::BlobStorageContext* blob_storage_context,
+ bool skip_service_worker,
+ ResourceType resource_type,
+ RequestContextType request_context_type,
+ RequestContextFrameType frame_type,
+ bool is_parent_frame_secure,
+ scoped_refptr<ResourceRequestBodyImpl> body,
+#if 0
+ const base::Callback<WebContents*(void)>& web_contents_getter,
+ NetworkFallbackCallback network_fallback_callback);
+#endif
+ const base::Callback<WebContents*(void)>& web_contents_getter);
+
std::unique_ptr<ServiceWorkerProviderHost> host_for_cross_site_transfer_;
int old_process_id_;
int old_provider_id_;

Powered by Google App Engine
This is Rietveld 408576698