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 2c5badcd5e11c2ca7f1a71ae40b66e60ddf8f82b..8f32a9fbcfcd4d537a2e38c1e2bf52da53b9a12d 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" |
@@ -353,9 +354,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(); |