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

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: Created 4 years, 6 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 648822822bc627cc3549f69ebe7d5a8a7d724206..7d0ab077ecf1da6d69dcd86b695eb83bc341f33f 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"
@@ -81,6 +83,10 @@ struct NavigationRequestInfo;
struct Referrer;
struct ResourceRequest;
+namespace mojom {
+class URLLoader;
+} // namespace mojom
+
// This class is responsible for notifying the IO thread (specifically, the
// ResourceDispatcherHostImpl) of frame events. It has an interace for callers
// to use and also sends notifications on WebContentsObserver events. All
@@ -318,9 +324,19 @@ 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);
+
private:
friend class LoaderIOThreadNotifier;
friend class ResourceDispatcherHostTest;
+ class MojoHelper;
kinuko 2016/06/14 08:45:29 no longer needed
yhirano 2016/07/12 10:49:11 Done.
FRIEND_TEST_ALL_PREFIXES(ResourceDispatcherHostTest,
TestBlockedRequestsProcessDies);
@@ -466,6 +482,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 +506,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,
+ mojom::URLLoaderClientPtr url_loader_client);
// Creates a ResourceHandler to be used by BeginRequest() for normal resource
// loading.
@@ -494,7 +519,9 @@ class CONTENT_EXPORT ResourceDispatcherHostImpl
int route_id,
int process_type,
int child_id,
- ResourceContext* resource_context);
+ ResourceContext* resource_context,
+ std::unique_ptr<mojom::URLLoader> url_loader,
+ 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