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

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

Issue 1970693002: Use mojo for Chrome Loading, Part 1 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 5 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_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 339daec4d5d6a909fe8f05f1e134db52e5d8a370..f72cb96f26ee62da04378c62b6ca207035ad3368 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/common/request_context_type.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"
@@ -74,6 +76,10 @@ struct NavigationRequestInfo;
struct Referrer;
struct ResourceRequest;
+namespace mojom {
+class URLLoader;
+} // namespace mojom
+
class CONTENT_EXPORT ResourceDispatcherHostImpl
: public ResourceDispatcherHost,
public ResourceLoaderDelegate {
@@ -282,6 +288,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();
@@ -292,6 +302,16 @@ class CONTENT_EXPORT ResourceDispatcherHostImpl
void OnRenderFrameDeleted(const GlobalFrameRoutingId& global_routing_id);
+ // This function is used when loading with mojo.
+ // Called when loading a request with mojo.
kinuko 2016/08/03 18:20:07 nit: these two lines of comment feel a bit verbose
yhirano 2016/08/04 12:50:51 Done.
+ 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 ResourceDispatcherHostTest;
@@ -435,6 +455,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);
@@ -452,7 +480,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.
@@ -463,7 +493,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

Powered by Google App Engine
This is Rietveld 408576698