| 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 61dd8b5f17ef99c5f8a574e5d530b04bf09df406..563a36d36bfad155b0b5427d89b59d79f629f395 100644
|
| --- a/content/browser/service_worker/service_worker_request_handler.h
|
| +++ b/content/browser/service_worker/service_worker_request_handler.h
|
| @@ -12,9 +12,11 @@
|
| #include "base/memory/weak_ptr.h"
|
| #include "base/supports_user_data.h"
|
| #include "base/time/time.h"
|
| +#include "content/browser/service_worker/service_worker_url_loader_factory.h"
|
| #include "content/common/content_export.h"
|
| #include "content/common/service_worker/service_worker_status_code.h"
|
| #include "content/common/service_worker/service_worker_types.h"
|
| +#include "content/common/url_loader_factory.mojom.h"
|
| #include "content/public/common/request_context_frame_type.h"
|
| #include "content/public/common/request_context_type.h"
|
| #include "content/public/common/resource_type.h"
|
| @@ -33,6 +35,7 @@ class BlobStorageContext;
|
| namespace content {
|
|
|
| class ResourceContext;
|
| +struct ResourceRequest;
|
| class ResourceRequestBodyImpl;
|
| class ServiceWorkerContextCore;
|
| class ServiceWorkerContextWrapper;
|
| @@ -49,7 +52,23 @@ 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,
|
| + ResourceType resource_type,
|
| + RequestContextType request_context_type,
|
| + RequestContextFrameType frame_type,
|
| + bool is_parent_frame_secure,
|
| + scoped_refptr<ResourceRequestBodyImpl> body,
|
| + const base::Callback<WebContents*(void)>& web_contents_getter);
|
| +
|
| + // PlzNavigate and --enable-network-service
|
| + // Same as InitializeForNavigation(), but instead of attaching to a request,
|
| + // returns a URLLoaderFactoryPtr if the request needs to be handled.
|
| + static mojom::URLLoaderFactoryPtrInfo InitializeForNavigationNetworkService(
|
| + const ResourceRequest& resource_request,
|
| + ResourceContext* resource_context,
|
| ServiceWorkerNavigationHandleCore* navigation_handle_core,
|
| storage::BlobStorageContext* blob_storage_context,
|
| bool skip_service_worker,
|
| @@ -109,6 +128,13 @@ class CONTENT_EXPORT ServiceWorkerRequestHandler
|
| net::NetworkDelegate* network_delegate,
|
| ResourceContext* context) = 0;
|
|
|
| + virtual mojom::URLLoaderFactoryPtrInfo MaybeCreateURLLoader(
|
| + const ResourceRequest& resource_request,
|
| + ResourceContext* resource_context,
|
| + std::unique_ptr<ServiceWorkerRequestHandler> request_handler) {
|
| + return mojom::URLLoaderFactoryPtrInfo();
|
| + }
|
| +
|
| // Methods to support cross site navigations.
|
| void PrepareForCrossSiteTransfer(int old_process_id);
|
| void CompleteCrossSiteTransfer(int new_process_id,
|
| @@ -120,6 +146,9 @@ class CONTENT_EXPORT ServiceWorkerRequestHandler
|
| // site transfer navigations.
|
| bool SanityCheckIsSameContext(ServiceWorkerContextWrapper* wrapper);
|
|
|
| + using HandlerCreated =
|
| + base::Callback<void(std::unique_ptr<ServiceWorkerRequestHandler>)>;
|
| +
|
| protected:
|
| ServiceWorkerRequestHandler(
|
| base::WeakPtr<ServiceWorkerContextCore> context,
|
| @@ -133,6 +162,19 @@ class CONTENT_EXPORT ServiceWorkerRequestHandler
|
| ResourceType resource_type_;
|
|
|
| private:
|
| + static void InitializeForNavigationImpl(
|
| + 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,
|
| + const base::Callback<WebContents*(void)>& web_contents_getter,
|
| + const HandlerCreated& on_handler_created);
|
| +
|
| std::unique_ptr<ServiceWorkerProviderHost> host_for_cross_site_transfer_;
|
| int old_process_id_;
|
| int old_provider_id_;
|
|
|