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

Side by Side Diff: content/browser/loader/resource_dispatcher_host_impl.h

Issue 2503813002: Fix and refactor downloaded file handling in the loading stack (Closed)
Patch Set: revert an unrelated change 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 unified diff | Download patch
OLDNEW
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 // This is the browser side of the resource dispatcher, it receives requests 5 // This is the browser side of the resource dispatcher, it receives requests
6 // from the child process (i.e. [Renderer, Plugin, Worker]ProcessHost), and 6 // from the child process (i.e. [Renderer, Plugin, Worker]ProcessHost), and
7 // dispatches them to URLRequests. It then forwards the messages from the 7 // dispatches them to URLRequests. It then forwards the messages from the
8 // URLRequests back to the correct process for handling. 8 // URLRequests back to the correct process for handling.
9 // 9 //
10 // See http://dev.chromium.org/developers/design-documents/multi-process-resourc e-loading 10 // See http://dev.chromium.org/developers/design-documents/multi-process-resourc e-loading
(...skipping 30 matching lines...) Expand all
41 #include "ipc/ipc_message.h" 41 #include "ipc/ipc_message.h"
42 #include "mojo/public/cpp/system/data_pipe.h" 42 #include "mojo/public/cpp/system/data_pipe.h"
43 #include "net/base/request_priority.h" 43 #include "net/base/request_priority.h"
44 #include "net/cookies/canonical_cookie.h" 44 #include "net/cookies/canonical_cookie.h"
45 #include "net/url_request/url_request.h" 45 #include "net/url_request/url_request.h"
46 46
47 namespace base { 47 namespace base {
48 class FilePath; 48 class FilePath;
49 } 49 }
50 50
51 namespace storage {
52 class ShareableFileReference;
53 }
54
55 namespace content { 51 namespace content {
56 class AppCacheService; 52 class AppCacheService;
57 class AsyncRevalidationManager; 53 class AsyncRevalidationManager;
54 class DownloadedTempFileImpl;
58 class LoaderDelegate; 55 class LoaderDelegate;
59 class NavigationURLLoaderImplCore; 56 class NavigationURLLoaderImplCore;
60 class NavigationUIData; 57 class NavigationUIData;
61 class RenderFrameHostImpl; 58 class RenderFrameHostImpl;
62 class ResourceContext; 59 class ResourceContext;
63 class ResourceDispatcherHostDelegate; 60 class ResourceDispatcherHostDelegate;
64 class ResourceHandler; 61 class ResourceHandler;
65 class ResourceMessageDelegate; 62 class ResourceMessageDelegate;
66 class ResourceMessageFilter; 63 class ResourceMessageFilter;
67 class ResourceRequestInfoImpl; 64 class ResourceRequestInfoImpl;
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
207 204
208 // Cancels any blocked request for the specified route id. 205 // Cancels any blocked request for the specified route id.
209 void CancelBlockedRequestsForRoute( 206 void CancelBlockedRequestsForRoute(
210 const GlobalFrameRoutingId& global_routing_id); 207 const GlobalFrameRoutingId& global_routing_id);
211 208
212 // Maintains a collection of temp files created in support of 209 // Maintains a collection of temp files created in support of
213 // the download_to_file capability. Used to grant access to the 210 // the download_to_file capability. Used to grant access to the
214 // child process and to defer deletion of the file until it's 211 // child process and to defer deletion of the file until it's
215 // no longer needed. 212 // no longer needed.
216 void RegisterDownloadedTempFile( 213 void RegisterDownloadedTempFile(
217 int child_id, int request_id, 214 std::unique_ptr<DownloadedTempFileImpl> downloaded_temp_file);
218 const base::FilePath& file_path);
219 void UnregisterDownloadedTempFile(int child_id, int request_id); 215 void UnregisterDownloadedTempFile(int child_id, int request_id);
220 216
221 // Needed for the sync IPC message dispatcher macros. 217 // Needed for the sync IPC message dispatcher macros.
222 bool Send(IPC::Message* message); 218 bool Send(IPC::Message* message);
223 219
224 // Indicates whether third-party sub-content can pop-up HTTP basic auth 220 // Indicates whether third-party sub-content can pop-up HTTP basic auth
225 // dialog boxes. 221 // dialog boxes.
226 bool allow_cross_origin_auth_prompt(); 222 bool allow_cross_origin_auth_prompt();
227 223
228 ResourceDispatcherHostDelegate* delegate() { 224 ResourceDispatcherHostDelegate* delegate() {
(...skipping 444 matching lines...) Expand 10 before | Expand all | Expand 10 after
673 std::unique_ptr<ResourceHandler> handler, 669 std::unique_ptr<ResourceHandler> handler,
674 bool is_content_initiated, 670 bool is_content_initiated,
675 bool must_download, 671 bool must_download,
676 bool is_new_request); 672 bool is_new_request);
677 673
678 LoaderMap pending_loaders_; 674 LoaderMap pending_loaders_;
679 675
680 // Collection of temp files downloaded for child processes via 676 // Collection of temp files downloaded for child processes via
681 // the download_to_file mechanism. We avoid deleting them until 677 // the download_to_file mechanism. We avoid deleting them until
682 // the client no longer needs them. 678 // the client no longer needs them.
683 typedef std::map<int, scoped_refptr<storage::ShareableFileReference> > 679 typedef std::map<int, std::unique_ptr<DownloadedTempFileImpl>>
684 DeletableFilesMap; // key is request id 680 DeletableFilesMap; // key is request id
685 typedef std::map<int, DeletableFilesMap> 681 typedef std::map<int, DeletableFilesMap>
686 RegisteredTempFiles; // key is child process id 682 RegisteredTempFiles; // key is child process id
687 RegisteredTempFiles registered_temp_files_; 683 RegisteredTempFiles registered_temp_files_;
688 684
689 // A timer that periodically calls UpdateLoadInfo while pending_loaders_ is 685 // A timer that periodically calls UpdateLoadInfo while pending_loaders_ is
690 // not empty and at least one RenderViewHost is loading. 686 // not empty and at least one RenderViewHost is loading.
691 std::unique_ptr<base::RepeatingTimer> update_load_states_timer_; 687 std::unique_ptr<base::RepeatingTimer> update_load_states_timer_;
692 688
693 // Request ID for browser initiated requests. request_ids generated by 689 // Request ID for browser initiated requests. request_ids generated by
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
767 763
768 // Points to the registered download handler intercept. 764 // Points to the registered download handler intercept.
769 CreateDownloadHandlerIntercept create_download_handler_intercept_; 765 CreateDownloadHandlerIntercept create_download_handler_intercept_;
770 766
771 DISALLOW_COPY_AND_ASSIGN(ResourceDispatcherHostImpl); 767 DISALLOW_COPY_AND_ASSIGN(ResourceDispatcherHostImpl);
772 }; 768 };
773 769
774 } // namespace content 770 } // namespace content
775 771
776 #endif // CONTENT_BROWSER_LOADER_RESOURCE_DISPATCHER_HOST_IMPL_H_ 772 #endif // CONTENT_BROWSER_LOADER_RESOURCE_DISPATCHER_HOST_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698