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

Unified Diff: content/browser/loader/resource_dispatcher_host_impl.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/resource_dispatcher_host_impl.cc
diff --git a/content/browser/loader/resource_dispatcher_host_impl.cc b/content/browser/loader/resource_dispatcher_host_impl.cc
index 4117eae4cdc25ff63a0a9027ed0d186bd863423c..6a9619422de8541e9279d139c0e0ee671f2676fd 100644
--- a/content/browser/loader/resource_dispatcher_host_impl.cc
+++ b/content/browser/loader/resource_dispatcher_host_impl.cc
@@ -45,6 +45,7 @@
#include "content/browser/loader/async_resource_handler.h"
#include "content/browser/loader/async_revalidation_manager.h"
#include "content/browser/loader/detachable_resource_handler.h"
+#include "content/browser/loader/downloaded_temp_file_impl.h"
#include "content/browser/loader/intercepting_resource_handler.h"
#include "content/browser/loader/loader_delegate.h"
#include "content/browser/loader/mime_sniffing_resource_handler.h"
@@ -1769,12 +1770,13 @@ void ResourceDispatcherHostImpl::OnDidChangePriority(
}
void ResourceDispatcherHostImpl::RegisterDownloadedTempFile(
- int child_id, int request_id, const base::FilePath& file_path) {
- scoped_refptr<ShareableFileReference> reference =
- ShareableFileReference::Get(file_path);
- DCHECK(reference.get());
+ std::unique_ptr<DownloadedTempFileImpl> downloaded_file) {
mmenke 2016/11/17 16:59:33 Do we even need to change all this? Would it be b
tzik 2016/11/22 13:54:45 OK, let me take the second: Let the Mojo object in
+ int child_id = downloaded_file->child_id();
+ int request_id = downloaded_file->request_id();
+ scoped_refptr<storage::ShareableFileReference> reference =
dcheng 2016/11/17 11:16:02 Are lines 1774-1776 still needed?
tzik 2016/11/22 13:54:45 Reverted.
+ downloaded_file->reference();
- registered_temp_files_[child_id][request_id] = reference;
+ registered_temp_files_[child_id][request_id] = std::move(downloaded_file);
ChildProcessSecurityPolicyImpl::GetInstance()->GrantReadFile(
child_id, reference->path());

Powered by Google App Engine
This is Rietveld 408576698