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

Unified Diff: content/child/resource_dispatcher.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, 4 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
« no previous file with comments | « content/browser/renderer_host/render_process_host_impl.cc ('k') | content/child/resource_dispatcher.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/child/resource_dispatcher.h
diff --git a/content/child/resource_dispatcher.h b/content/child/resource_dispatcher.h
index 11485286edaa714b04f92a3442c19b8627ff9773..5ef632fdf4b9f2499e1670359babd05ffbdedfd3 100644
--- a/content/child/resource_dispatcher.h
+++ b/content/child/resource_dispatcher.h
@@ -22,10 +22,12 @@
#include "base/single_thread_task_runner.h"
#include "base/time/time.h"
#include "content/common/content_export.h"
+#include "content/common/url_loader.mojom.h"
#include "content/public/common/resource_type.h"
#include "ipc/ipc_listener.h"
#include "ipc/ipc_sender.h"
#include "net/base/request_priority.h"
+#include "third_party/WebKit/public/platform/WebURLRequest.h"
#include "url/gurl.h"
namespace net {
@@ -46,6 +48,10 @@ class SharedMemoryReceivedDataFactory;
struct SiteIsolationResponseMetaData;
struct SyncLoadResponse;
+namespace mojom {
+class URLLoaderFactory;
+} // namespace mojom
+
// This class serves as a communication interface to the ResourceDispatcherHost
// in the browser process. It can be used from any child process.
// Virtual methods are for tests.
@@ -68,14 +74,19 @@ class CONTENT_EXPORT ResourceDispatcher : public IPC::Listener {
// response parameter.
virtual void StartSync(const RequestInfo& request_info,
ResourceRequestBodyImpl* request_body,
- SyncLoadResponse* response);
+ SyncLoadResponse* response,
+ blink::WebURLRequest::LoadingIPCType ipc_type,
+ mojom::URLLoaderFactory* url_loader_factory);
// Call this method to initiate the request. If this method succeeds, then
// the peer's methods will be called asynchronously to report various events.
- // Returns the request id.
+ // Returns the request id. |url_loader_factory| must be non-null if and only
+ // if |ipc_type| is LoadingIPCType::Mojo.
virtual int StartAsync(const RequestInfo& request_info,
ResourceRequestBodyImpl* request_body,
- std::unique_ptr<RequestPeer> peer);
+ std::unique_ptr<RequestPeer> peer,
+ blink::WebURLRequest::LoadingIPCType ipc_type,
+ mojom::URLLoaderFactory* url_loader_factory);
// Removes a request from the |pending_requests_| list, returning true if the
// request was found and removed.
@@ -119,6 +130,7 @@ class CONTENT_EXPORT ResourceDispatcher : public IPC::Listener {
scoped_refptr<ResourceSchedulingFilter> resource_scheduling_filter);
private:
+ friend class URLResponseBodyConsumer;
friend class ResourceDispatcherTest;
typedef std::deque<IPC::Message*> MessageQueue;
@@ -155,6 +167,10 @@ class CONTENT_EXPORT ResourceDispatcher : public IPC::Listener {
scoped_refptr<SharedMemoryReceivedDataFactory> received_data_factory;
std::unique_ptr<SiteIsolationResponseMetaData> site_isolation_metadata;
int buffer_size;
+
+ // For mojo loading.
+ mojom::URLLoaderPtr url_loader;
+ std::unique_ptr<mojom::URLLoaderClient> url_loader_client;
};
using PendingRequestMap = std::map<int, std::unique_ptr<PendingRequestInfo>>;
« no previous file with comments | « content/browser/renderer_host/render_process_host_impl.cc ('k') | content/child/resource_dispatcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698