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

Unified Diff: content/browser/loader/async_resource_handler.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/browser/loader/async_resource_handler.cc
diff --git a/content/browser/loader/async_resource_handler.cc b/content/browser/loader/async_resource_handler.cc
index 69df993843453e1105111ba1193f1c8dc8fe3edd..effea4dd06f5c66aaefb64a8ec040fb75d6c5f4a 100644
--- a/content/browser/loader/async_resource_handler.cc
+++ b/content/browser/loader/async_resource_handler.cc
@@ -17,6 +17,7 @@
#include "base/metrics/histogram_macros.h"
#include "base/strings/string_number_conversions.h"
#include "base/time/time.h"
+#include "content/browser/loader/downloaded_temp_file_impl.h"
#include "content/browser/loader/netlog_observer.h"
#include "content/browser/loader/resource_buffer.h"
#include "content/browser/loader/resource_dispatcher_host_impl.h"
@@ -354,9 +355,10 @@ bool AsyncResourceHandler::OnResponseStarted(ResourceResponse* response,
// If the parent handler downloaded the resource to a file, grant the child
// read permissions on it.
if (!response->head.download_file_path.empty()) {
- rdh_->RegisterDownloadedTempFile(
- info->GetChildID(), info->GetRequestID(),
+ auto downloaded_file = base::MakeUnique<DownloadedTempFileImpl>(
+ rdh_, info->GetChildID(), info->GetRequestID(),
response->head.download_file_path);
+ rdh_->RegisterDownloadedTempFile(std::move(downloaded_file));
}
response->head.request_start = request()->creation_time();

Powered by Google App Engine
This is Rietveld 408576698