Chromium Code Reviews| 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 0cd8d209ce494bc03930948fa92358515f2a7096..670584234015bc64dd095ce438382295f8423656 100644 |
| --- a/content/browser/loader/resource_dispatcher_host_impl.h |
| +++ b/content/browser/loader/resource_dispatcher_host_impl.h |
| @@ -84,6 +84,9 @@ class CONTENT_EXPORT ResourceDispatcherHostImpl |
| : public ResourceDispatcherHost, |
| public ResourceLoaderDelegate { |
| public: |
| + using SyncLoadResultCallback = |
| + base::Callback<void(const SyncLoadResult* result)>; |
|
mmenke
2016/10/05 15:21:33
Need to document this.
tzik
2016/10/06 12:52:03
Done.
|
| + |
| // 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 +535,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 +555,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 +568,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, |