Index: content/child/resource_dispatcher.cc |
diff --git a/content/child/resource_dispatcher.cc b/content/child/resource_dispatcher.cc |
index 04759bbe674cb12b9965bd6616a16b074732af80..2fafeb75e1b3a297fe5b2b1723af4541d5ea30af 100644 |
--- a/content/child/resource_dispatcher.cc |
+++ b/content/child/resource_dispatcher.cc |
@@ -416,7 +416,10 @@ bool ResourceDispatcher::RemovePendingRequest(int request_id) { |
PendingRequestInfo* request_info = it->second.get(); |
- bool release_downloaded_file = request_info->download_to_file; |
+ // |url_loader_client| releases the downloaded file. Otherwise (i.e., we |
+ // are using Chrome IPC), we should release it here. |
dcheng
2017/03/01 01:57:49
Ah I see. Thanks!
|
+ bool release_downloaded_file = |
+ request_info->download_to_file && !it->second->url_loader_client; |
ReleaseResourcesInMessageQueue(&request_info->deferred_message_queue); |
@@ -673,11 +676,11 @@ int ResourceDispatcher::StartAsync( |
std::unique_ptr<URLLoaderClientImpl> client( |
new URLLoaderClientImpl(request_id, this, std::move(task_runner))); |
mojom::URLLoaderAssociatedPtr url_loader; |
- mojom::URLLoaderClientAssociatedPtrInfo client_ptr_info; |
- client->Bind(&client_ptr_info); |
+ mojom::URLLoaderClientPtr client_ptr; |
+ client->Bind(&client_ptr); |
url_loader_factory->CreateLoaderAndStart(MakeRequest(&url_loader), |
routing_id, request_id, *request, |
- std::move(client_ptr_info)); |
+ std::move(client_ptr)); |
pending_requests_[request_id]->url_loader = std::move(url_loader); |
pending_requests_[request_id]->url_loader_client = std::move(client); |
} else { |