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

Unified Diff: content/child/resource_dispatcher.cc

Issue 2503813002: Fix and refactor downloaded file handling in the loading stack (Closed)
Patch Set: +RunUntilIdle Created 4 years, 1 month 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 e242b5eda9421e57bec96e99eb7c88e344dd1d98..9e382336b67fd97d3204c492878cb4a29678fb25 100644
--- a/content/child/resource_dispatcher.cc
+++ b/content/child/resource_dispatcher.cc
@@ -90,10 +90,13 @@ class URLLoaderClientImpl final : public mojom::URLLoaderClient {
body_consumer_->Cancel();
}
- void OnReceiveResponse(const ResourceResponseHead& response_head) override {
+ void OnReceiveResponse(
+ const ResourceResponseHead& response_head,
+ mojom::DownloadedTempFilePtr downloaded_file) override {
has_received_response_ = true;
if (body_consumer_)
body_consumer_->Start(task_runner_.get());
+ downloaded_file_ = std::move(downloaded_file);
resource_dispatcher_->OnMessageReceived(
ResourceMsg_ReceivedResponse(request_id_, response_head));
}
@@ -137,6 +140,7 @@ class URLLoaderClientImpl final : public mojom::URLLoaderClient {
private:
mojo::AssociatedBinding<mojom::URLLoaderClient> binding_;
scoped_refptr<URLResponseBodyConsumer> body_consumer_;
+ mojom::DownloadedTempFilePtr downloaded_file_;
const int request_id_;
bool has_received_response_ = false;
ResourceDispatcher* const resource_dispatcher_;

Powered by Google App Engine
This is Rietveld 408576698