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

Unified Diff: content/child/resource_dispatcher.cc

Issue 2715423003: [Mojo-Loading] Use independent URLLoaderClient (Closed)
Patch Set: fix Created 3 years, 10 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/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 {
« no previous file with comments | « content/browser/service_worker/service_worker_fetch_dispatcher.cc ('k') | content/child/url_loader_client_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698