| Index: content/browser/loader/resource_dispatcher_host_impl.h
|
| diff --git a/content/browser/loader/resource_dispatcher_host_impl.h b/content/browser/loader/resource_dispatcher_host_impl.h
|
| index 02d1b5b42889d176a405c900669428266c746cdf..69378d130a54ea0ca77648fd6fb4d872c97ade62 100644
|
| --- a/content/browser/loader/resource_dispatcher_host_impl.h
|
| +++ b/content/browser/loader/resource_dispatcher_host_impl.h
|
| @@ -33,6 +33,7 @@
|
| #include "content/browser/loader/resource_scheduler.h"
|
| #include "content/common/content_export.h"
|
| #include "content/common/resource_request_body.h"
|
| +#include "content/common/url_loader.mojom.h"
|
| #include "content/public/browser/child_process_data.h"
|
| #include "content/public/browser/download_item.h"
|
| #include "content/public/browser/download_url_parameters.h"
|
| @@ -42,6 +43,7 @@
|
| #include "content/public/browser/web_contents_observer.h"
|
| #include "content/public/common/resource_type.h"
|
| #include "ipc/ipc_message.h"
|
| +#include "mojo/public/cpp/system/data_pipe.h"
|
| #include "net/base/request_priority.h"
|
| #include "net/cookies/canonical_cookie.h"
|
| #include "net/url_request/url_request.h"
|
| @@ -80,6 +82,8 @@ struct DownloadSaveInfo;
|
| struct NavigationRequestInfo;
|
| struct Referrer;
|
| struct ResourceRequest;
|
| +struct ResourceRequestCompletionStatus;
|
| +struct ResourceResponseHead;
|
|
|
| // This class is responsible for notifying the IO thread (specifically, the
|
| // ResourceDispatcherHostImpl) of frame events. It has an interace for callers
|
| @@ -318,9 +322,37 @@ class CONTENT_EXPORT ResourceDispatcherHostImpl
|
| // or experiment status. For unit tests only.
|
| void EnableStaleWhileRevalidateForTesting();
|
|
|
| + // These functions are used when loading with mojo.
|
| + // Called when loading a request with mojo.
|
| + void OnRequestResourceWithMojo(int routing_id,
|
| + int request_id,
|
| + const ResourceRequest& request,
|
| + std::unique_ptr<mojom::URLLoader> url_loader,
|
| + mojom::URLLoaderClientPtr url_loader_client,
|
| + ResourceMessageFilter* filter);
|
| +
|
| + // Sends |message| with mojo if it is possible and returns whether the message
|
| + // is sent.
|
| + bool SendWithMojoIfPossible(const IPC::Message& message,
|
| + ResourceMessageFilter* filter);
|
| +
|
| + // Call |OnStartResponseBody| for the client associated with |id|.
|
| + void OnStartLoadingResponseBodyWithMojo(
|
| + const GlobalRequestID& id,
|
| + mojo::ScopedDataPipeConsumerHandle response_body);
|
| +
|
| + // Add an uninitiated (i.e., resource loading is not yet started) loader in
|
| + // order to keep it alive.
|
| + void AddUninitiatedURLLoader(int child_id,
|
| + std::unique_ptr<mojom::URLLoader> loader);
|
| + // Returns an uninitiated URL loader whose raw pointer equals to |loader|.
|
| + std::unique_ptr<mojom::URLLoader> TakeUninitiatedURLLoader(
|
| + mojom::URLLoader* loader);
|
| +
|
| private:
|
| friend class LoaderIOThreadNotifier;
|
| friend class ResourceDispatcherHostTest;
|
| + class MojoHelper;
|
|
|
| FRIEND_TEST_ALL_PREFIXES(ResourceDispatcherHostTest,
|
| TestBlockedRequestsProcessDies);
|
| @@ -371,8 +403,11 @@ class CONTENT_EXPORT ResourceDispatcherHostImpl
|
| void OnRenderFrameDeleted(const GlobalFrameRoutingId& global_routing_id);
|
|
|
| // Helper function for regular and download requests.
|
| - void BeginRequestInternal(std::unique_ptr<net::URLRequest> request,
|
| - std::unique_ptr<ResourceHandler> handler);
|
| + void BeginRequestInternal(
|
| + std::unique_ptr<net::URLRequest> request,
|
| + std::unique_ptr<ResourceHandler> handler,
|
| + std::unique_ptr<mojom::URLLoader> url_loader = nullptr,
|
| + mojom::URLLoaderClientPtr url_loader_client = nullptr);
|
|
|
| void StartLoading(ResourceRequestInfoImpl* info,
|
| std::unique_ptr<ResourceLoader> loader);
|
| @@ -466,6 +501,13 @@ class CONTENT_EXPORT ResourceDispatcherHostImpl
|
| void OnRequestResource(int routing_id,
|
| int request_id,
|
| const ResourceRequest& request_data);
|
| +
|
| + void OnRequestResourceInternal(int routing_id,
|
| + int request_id,
|
| + const ResourceRequest& request_data,
|
| + std::unique_ptr<mojom::URLLoader> url_loader,
|
| + mojom::URLLoaderClientPtr url_loader_client);
|
| +
|
| void OnSyncLoad(int request_id,
|
| const ResourceRequest& request_data,
|
| IPC::Message* sync_result);
|
| @@ -483,7 +525,9 @@ class CONTENT_EXPORT ResourceDispatcherHostImpl
|
| void BeginRequest(int request_id,
|
| const ResourceRequest& request_data,
|
| IPC::Message* sync_result, // only valid for sync
|
| - int route_id); // only valid for async
|
| + int route_id, // only valid for async
|
| + std::unique_ptr<mojom::URLLoader> url_loader = nullptr,
|
| + mojom::URLLoaderClientPtr url_loader_client = nullptr);
|
|
|
| // Creates a ResourceHandler to be used by BeginRequest() for normal resource
|
| // loading.
|
| @@ -494,7 +538,8 @@ class CONTENT_EXPORT ResourceDispatcherHostImpl
|
| int route_id,
|
| int process_type,
|
| int child_id,
|
| - ResourceContext* resource_context);
|
| + ResourceContext* resource_context,
|
| + bool using_mojo);
|
|
|
| // Wraps |handler| in the standard resource handlers for normal resource
|
| // loading and navigation requests. This adds MimeTypeResourceHandler and
|
| @@ -663,6 +708,8 @@ class CONTENT_EXPORT ResourceDispatcherHostImpl
|
| // outlive this ResourceDispatcherHostImpl.
|
| CertStore* cert_store_for_testing_;
|
|
|
| + std::unique_ptr<MojoHelper> mojo_helper_;
|
| +
|
| DISALLOW_COPY_AND_ASSIGN(ResourceDispatcherHostImpl);
|
| };
|
|
|
|
|