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(); |