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

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

Issue 2390313002: Make SyncLoad result handling pluggable (Closed)
Patch Set: fix Created 4 years, 2 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 | « no previous file | content/browser/loader/resource_dispatcher_host_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 0ee50dfa24c5337f1d408331bde5ca0eab2a4013..0f37ff1cee84bc6b15eed51f24aeaa7415b7c9d6 100644
--- a/content/browser/loader/resource_dispatcher_host_impl.h
+++ b/content/browser/loader/resource_dispatcher_host_impl.h
@@ -19,6 +19,7 @@
#include <string>
#include <vector>
+#include "base/callback_forward.h"
#include "base/gtest_prod_util.h"
#include "base/macros.h"
#include "base/observer_list.h"
@@ -84,6 +85,11 @@ class CONTENT_EXPORT ResourceDispatcherHostImpl
: public ResourceDispatcherHost,
public ResourceLoaderDelegate {
public:
+ // Used to handle the result of SyncLoad IPC. |result| is null if it's
+ // unavailable due to an error.
+ using SyncLoadResultCallback =
+ base::Callback<void(const SyncLoadResult* result)>;
+
// This constructor should be used if we want downloads to work correctly.
// TODO(ananta)
// Work on moving creation of download handlers out of
@@ -532,12 +538,13 @@ class CONTENT_EXPORT ResourceDispatcherHostImpl
const ResourceRequest& request_data,
LoaderMap::iterator iter);
- void BeginRequest(int request_id,
- const ResourceRequest& request_data,
- IPC::Message* sync_result, // only valid for sync
- int route_id, // only valid for async
- mojo::InterfaceRequest<mojom::URLLoader> mojo_request,
- mojom::URLLoaderClientPtr url_loader_client);
+ void BeginRequest(
+ int request_id,
+ const ResourceRequest& request_data,
+ const SyncLoadResultCallback& sync_result_handler, // only valid for sync
+ int route_id, // only valid for async
+ mojo::InterfaceRequest<mojom::URLLoader> mojo_request,
+ mojom::URLLoaderClientPtr url_loader_client);
// There are requests which need decisions to be made like the following:
// Whether the presence of certain HTTP headers like the Origin header are
@@ -551,7 +558,7 @@ class CONTENT_EXPORT ResourceDispatcherHostImpl
void ContinuePendingBeginRequest(
int request_id,
const ResourceRequest& request_data,
- IPC::Message* sync_result, // only valid for sync
+ const SyncLoadResultCallback& sync_result_handler, // only valid for sync
int route_id,
const net::HttpRequestHeaders& headers,
mojo::InterfaceRequest<mojom::URLLoader> mojo_request,
@@ -564,7 +571,7 @@ class CONTENT_EXPORT ResourceDispatcherHostImpl
std::unique_ptr<ResourceHandler> CreateResourceHandler(
net::URLRequest* request,
const ResourceRequest& request_data,
- IPC::Message* sync_result,
+ const SyncLoadResultCallback& sync_result_handler,
int route_id,
int process_type,
int child_id,
« no previous file with comments | « no previous file | content/browser/loader/resource_dispatcher_host_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698