Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 // See http://dev.chromium.org/developers/design-documents/multi-process-resourc e-loading | 5 // See http://dev.chromium.org/developers/design-documents/multi-process-resourc e-loading |
| 6 | 6 |
| 7 #include "content/browser/loader/resource_dispatcher_host_impl.h" | 7 #include "content/browser/loader/resource_dispatcher_host_impl.h" |
| 8 | 8 |
| 9 #include <stddef.h> | 9 #include <stddef.h> |
| 10 | 10 |
| (...skipping 27 matching lines...) Expand all Loading... | |
| 38 #include "content/browser/bad_message.h" | 38 #include "content/browser/bad_message.h" |
| 39 #include "content/browser/blob_storage/chrome_blob_storage_context.h" | 39 #include "content/browser/blob_storage/chrome_blob_storage_context.h" |
| 40 #include "content/browser/child_process_security_policy_impl.h" | 40 #include "content/browser/child_process_security_policy_impl.h" |
| 41 #include "content/browser/frame_host/frame_tree.h" | 41 #include "content/browser/frame_host/frame_tree.h" |
| 42 #include "content/browser/frame_host/navigation_handle_impl.h" | 42 #include "content/browser/frame_host/navigation_handle_impl.h" |
| 43 #include "content/browser/frame_host/navigation_request_info.h" | 43 #include "content/browser/frame_host/navigation_request_info.h" |
| 44 #include "content/browser/frame_host/navigator.h" | 44 #include "content/browser/frame_host/navigator.h" |
| 45 #include "content/browser/loader/async_resource_handler.h" | 45 #include "content/browser/loader/async_resource_handler.h" |
| 46 #include "content/browser/loader/async_revalidation_manager.h" | 46 #include "content/browser/loader/async_revalidation_manager.h" |
| 47 #include "content/browser/loader/detachable_resource_handler.h" | 47 #include "content/browser/loader/detachable_resource_handler.h" |
| 48 #include "content/browser/loader/downloaded_temp_file_impl.h" | |
| 48 #include "content/browser/loader/intercepting_resource_handler.h" | 49 #include "content/browser/loader/intercepting_resource_handler.h" |
| 49 #include "content/browser/loader/loader_delegate.h" | 50 #include "content/browser/loader/loader_delegate.h" |
| 50 #include "content/browser/loader/mime_sniffing_resource_handler.h" | 51 #include "content/browser/loader/mime_sniffing_resource_handler.h" |
| 51 #include "content/browser/loader/mojo_async_resource_handler.h" | 52 #include "content/browser/loader/mojo_async_resource_handler.h" |
| 52 #include "content/browser/loader/navigation_resource_handler.h" | 53 #include "content/browser/loader/navigation_resource_handler.h" |
| 53 #include "content/browser/loader/navigation_resource_throttle.h" | 54 #include "content/browser/loader/navigation_resource_throttle.h" |
| 54 #include "content/browser/loader/navigation_url_loader_impl_core.h" | 55 #include "content/browser/loader/navigation_url_loader_impl_core.h" |
| 55 #include "content/browser/loader/power_save_block_resource_throttle.h" | 56 #include "content/browser/loader/power_save_block_resource_throttle.h" |
| 56 #include "content/browser/loader/redirect_to_file_resource_handler.h" | 57 #include "content/browser/loader/redirect_to_file_resource_handler.h" |
| 57 #include "content/browser/loader/resource_loader.h" | 58 #include "content/browser/loader/resource_loader.h" |
| (...skipping 1704 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1762 // The request may go away before processing this message, so |loader| can | 1763 // The request may go away before processing this message, so |loader| can |
| 1763 // legitimately be null. | 1764 // legitimately be null. |
| 1764 if (!loader) | 1765 if (!loader) |
| 1765 return; | 1766 return; |
| 1766 | 1767 |
| 1767 scheduler_->ReprioritizeRequest(loader->request(), new_priority, | 1768 scheduler_->ReprioritizeRequest(loader->request(), new_priority, |
| 1768 intra_priority_value); | 1769 intra_priority_value); |
| 1769 } | 1770 } |
| 1770 | 1771 |
| 1771 void ResourceDispatcherHostImpl::RegisterDownloadedTempFile( | 1772 void ResourceDispatcherHostImpl::RegisterDownloadedTempFile( |
| 1772 int child_id, int request_id, const base::FilePath& file_path) { | 1773 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
| |
| 1773 scoped_refptr<ShareableFileReference> reference = | 1774 int child_id = downloaded_file->child_id(); |
| 1774 ShareableFileReference::Get(file_path); | 1775 int request_id = downloaded_file->request_id(); |
| 1775 DCHECK(reference.get()); | 1776 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.
| |
| 1777 downloaded_file->reference(); | |
| 1776 | 1778 |
| 1777 registered_temp_files_[child_id][request_id] = reference; | 1779 registered_temp_files_[child_id][request_id] = std::move(downloaded_file); |
| 1778 ChildProcessSecurityPolicyImpl::GetInstance()->GrantReadFile( | 1780 ChildProcessSecurityPolicyImpl::GetInstance()->GrantReadFile( |
| 1779 child_id, reference->path()); | 1781 child_id, reference->path()); |
| 1780 | 1782 |
| 1781 // When the temp file is deleted, revoke permissions that the renderer has | 1783 // When the temp file is deleted, revoke permissions that the renderer has |
| 1782 // to that file. This covers an edge case where the file is deleted and then | 1784 // to that file. This covers an edge case where the file is deleted and then |
| 1783 // the same name is re-used for some other purpose, we don't want the old | 1785 // the same name is re-used for some other purpose, we don't want the old |
| 1784 // renderer to still have access to it. | 1786 // renderer to still have access to it. |
| 1785 // | 1787 // |
| 1786 // We do this when the file is deleted because the renderer can take a blob | 1788 // We do this when the file is deleted because the renderer can take a blob |
| 1787 // reference to the temp file that outlives the url loaded that it was | 1789 // reference to the temp file that outlives the url loaded that it was |
| (...skipping 1011 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2799 &throttles); | 2801 &throttles); |
| 2800 if (!throttles.empty()) { | 2802 if (!throttles.empty()) { |
| 2801 handler.reset(new ThrottlingResourceHandler(std::move(handler), request, | 2803 handler.reset(new ThrottlingResourceHandler(std::move(handler), request, |
| 2802 std::move(throttles))); | 2804 std::move(throttles))); |
| 2803 } | 2805 } |
| 2804 } | 2806 } |
| 2805 return handler; | 2807 return handler; |
| 2806 } | 2808 } |
| 2807 | 2809 |
| 2808 } // namespace content | 2810 } // namespace content |
| OLD | NEW |