| 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 a7242ff35e9530a2c3c322f0542f5c90445bf794..b23dd7063eae407faf6333aaf286c9c2be039c75 100644
|
| --- a/content/browser/loader/resource_dispatcher_host_impl.h
|
| +++ b/content/browser/loader/resource_dispatcher_host_impl.h
|
| @@ -31,11 +31,13 @@
|
| #include "content/browser/loader/resource_loader_delegate.h"
|
| #include "content/browser/loader/resource_scheduler.h"
|
| #include "content/common/content_export.h"
|
| +#include "content/common/url_loader.mojom.h"
|
| #include "content/public/browser/global_request_id.h"
|
| #include "content/public/browser/resource_dispatcher_host.h"
|
| #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"
|
| @@ -299,6 +301,10 @@ class CONTENT_EXPORT ResourceDispatcherHostImpl
|
| const NavigationRequestInfo& info,
|
| NavigationURLLoaderImplCore* loader);
|
|
|
| + int num_in_flight_requests_for_testing() const {
|
| + return num_in_flight_requests_;
|
| + }
|
| +
|
| // Turns on stale-while-revalidate support, regardless of command-line flags
|
| // or experiment status. For unit tests only.
|
| void EnableStaleWhileRevalidateForTesting();
|
| @@ -307,6 +313,16 @@ class CONTENT_EXPORT ResourceDispatcherHostImpl
|
| // transferred. The LoaderDelegate should be interacted with on the IO thread.
|
| void SetLoaderDelegate(LoaderDelegate* loader_delegate);
|
|
|
| + // This function is used when loading with mojo.
|
| + // Called when loading a request with mojo.
|
| + void OnRequestResourceWithMojo(
|
| + int routing_id,
|
| + int request_id,
|
| + const ResourceRequest& request,
|
| + mojo::InterfaceRequest<mojom::URLLoader> mojo_request,
|
| + mojom::URLLoaderClientPtr url_loader_client,
|
| + ResourceMessageFilter* filter);
|
| +
|
| private:
|
| friend class LoaderIOThreadNotifier;
|
| friend class ResourceDispatcherHostTest;
|
| @@ -453,6 +469,14 @@ 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,
|
| + mojo::InterfaceRequest<mojom::URLLoader> mojo_request,
|
| + mojom::URLLoaderClientPtr url_loader_client);
|
| +
|
| void OnSyncLoad(int request_id,
|
| const ResourceRequest& request_data,
|
| IPC::Message* sync_result);
|
| @@ -470,7 +494,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
|
| + mojo::InterfaceRequest<mojom::URLLoader> mojo_request,
|
| + mojom::URLLoaderClientPtr url_loader_client);
|
|
|
| // Creates a ResourceHandler to be used by BeginRequest() for normal resource
|
| // loading.
|
| @@ -481,7 +507,9 @@ class CONTENT_EXPORT ResourceDispatcherHostImpl
|
| int route_id,
|
| int process_type,
|
| int child_id,
|
| - ResourceContext* resource_context);
|
| + ResourceContext* resource_context,
|
| + mojo::InterfaceRequest<mojom::URLLoader> mojo_request,
|
| + mojom::URLLoaderClientPtr url_loader_client);
|
|
|
| // Wraps |handler| in the standard resource handlers for normal resource
|
| // loading and navigation requests. This adds MimeTypeResourceHandler and
|
|
|