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

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

Issue 11571025: Initial CL for Downloads resumption. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix try bot problems. Created 7 years, 12 months 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 | Annotate | Revision Log
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 10 matching lines...) Expand all
21 #include "base/gtest_prod_util.h" 21 #include "base/gtest_prod_util.h"
22 #include "base/memory/linked_ptr.h" 22 #include "base/memory/linked_ptr.h"
23 #include "base/memory/scoped_ptr.h" 23 #include "base/memory/scoped_ptr.h"
24 #include "base/time.h" 24 #include "base/time.h"
25 #include "base/timer.h" 25 #include "base/timer.h"
26 #include "content/browser/download/download_resource_handler.h" 26 #include "content/browser/download/download_resource_handler.h"
27 #include "content/browser/loader/resource_loader.h" 27 #include "content/browser/loader/resource_loader.h"
28 #include "content/browser/loader/resource_loader_delegate.h" 28 #include "content/browser/loader/resource_loader_delegate.h"
29 #include "content/common/content_export.h" 29 #include "content/common/content_export.h"
30 #include "content/public/browser/child_process_data.h" 30 #include "content/public/browser/child_process_data.h"
31 #include "content/public/browser/download_id.h"
31 #include "content/public/browser/notification_types.h" 32 #include "content/public/browser/notification_types.h"
32 #include "content/public/browser/resource_dispatcher_host.h" 33 #include "content/public/browser/resource_dispatcher_host.h"
33 #include "ipc/ipc_message.h" 34 #include "ipc/ipc_message.h"
34 #include "net/cookies/canonical_cookie.h" 35 #include "net/cookies/canonical_cookie.h"
35 #include "net/url_request/url_request.h" 36 #include "net/url_request/url_request.h"
36 #include "webkit/glue/resource_type.h" 37 #include "webkit/glue/resource_type.h"
37 38
38 class ResourceHandler; 39 class ResourceHandler;
39 struct ResourceHostMsg_Request; 40 struct ResourceHostMsg_Request;
40 struct ViewMsg_SwapOut_Params; 41 struct ViewMsg_SwapOut_Params;
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 virtual void SetDelegate(ResourceDispatcherHostDelegate* delegate) OVERRIDE; 74 virtual void SetDelegate(ResourceDispatcherHostDelegate* delegate) OVERRIDE;
74 virtual void SetAllowCrossOriginAuthPrompt(bool value) OVERRIDE; 75 virtual void SetAllowCrossOriginAuthPrompt(bool value) OVERRIDE;
75 virtual net::Error BeginDownload( 76 virtual net::Error BeginDownload(
76 scoped_ptr<net::URLRequest> request, 77 scoped_ptr<net::URLRequest> request,
77 bool is_content_initiated, 78 bool is_content_initiated,
78 ResourceContext* context, 79 ResourceContext* context,
79 int child_id, 80 int child_id,
80 int route_id, 81 int route_id,
81 bool prefer_cache, 82 bool prefer_cache,
82 scoped_ptr<DownloadSaveInfo> save_info, 83 scoped_ptr<DownloadSaveInfo> save_info,
84 const std::string& last_modified,
85 const std::string& etag,
86 content::DownloadId download_id,
83 const DownloadStartedCallback& started_callback) OVERRIDE; 87 const DownloadStartedCallback& started_callback) OVERRIDE;
84 virtual void ClearLoginDelegateForRequest(net::URLRequest* request) OVERRIDE; 88 virtual void ClearLoginDelegateForRequest(net::URLRequest* request) OVERRIDE;
85 virtual void BlockRequestsForRoute(int child_id, int route_id) OVERRIDE; 89 virtual void BlockRequestsForRoute(int child_id, int route_id) OVERRIDE;
86 virtual void ResumeBlockedRequestsForRoute( 90 virtual void ResumeBlockedRequestsForRoute(
87 int child_id, int route_id) OVERRIDE; 91 int child_id, int route_id) OVERRIDE;
88 92
89 // Puts the resource dispatcher host in an inactive state (unable to begin 93 // Puts the resource dispatcher host in an inactive state (unable to begin
90 // new requests). Cancels all pending requests. 94 // new requests). Cancels all pending requests.
91 void Shutdown(); 95 void Shutdown();
92 96
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
194 // Indicates whether third-party sub-content can pop-up HTTP basic auth 198 // Indicates whether third-party sub-content can pop-up HTTP basic auth
195 // dialog boxes. 199 // dialog boxes.
196 bool allow_cross_origin_auth_prompt(); 200 bool allow_cross_origin_auth_prompt();
197 201
198 ResourceDispatcherHostDelegate* delegate() { 202 ResourceDispatcherHostDelegate* delegate() {
199 return delegate_; 203 return delegate_;
200 } 204 }
201 205
202 // Must be called after the ResourceRequestInfo has been created 206 // Must be called after the ResourceRequestInfo has been created
203 // and associated with the request. 207 // and associated with the request.
208 // |id| should be |DownloadId()| (null) to request automatic
209 // assignment.
204 scoped_ptr<ResourceHandler> CreateResourceHandlerForDownload( 210 scoped_ptr<ResourceHandler> CreateResourceHandlerForDownload(
205 net::URLRequest* request, 211 net::URLRequest* request,
206 bool is_content_initiated, 212 bool is_content_initiated,
207 bool must_download, 213 bool must_download,
214 DownloadId id,
208 scoped_ptr<DownloadSaveInfo> save_info, 215 scoped_ptr<DownloadSaveInfo> save_info,
209 const DownloadResourceHandler::OnStartedCallback& started_cb); 216 const DownloadResourceHandler::OnStartedCallback& started_cb);
210 217
211 void ClearSSLClientAuthHandlerForRequest(net::URLRequest* request); 218 void ClearSSLClientAuthHandlerForRequest(net::URLRequest* request);
212 219
213 private: 220 private:
214 FRIEND_TEST_ALL_PREFIXES(ResourceDispatcherHostTest, 221 FRIEND_TEST_ALL_PREFIXES(ResourceDispatcherHostTest,
215 TestBlockedRequestsProcessDies); 222 TestBlockedRequestsProcessDies);
216 FRIEND_TEST_ALL_PREFIXES(ResourceDispatcherHostTest, 223 FRIEND_TEST_ALL_PREFIXES(ResourceDispatcherHostTest,
217 IncrementOutstandingRequestsMemoryCost); 224 IncrementOutstandingRequestsMemoryCost);
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after
413 // http://crbug.com/90971 - Assists in tracking down use-after-frees on 420 // http://crbug.com/90971 - Assists in tracking down use-after-frees on
414 // shutdown. 421 // shutdown.
415 std::set<const ResourceContext*> active_resource_contexts_; 422 std::set<const ResourceContext*> active_resource_contexts_;
416 423
417 DISALLOW_COPY_AND_ASSIGN(ResourceDispatcherHostImpl); 424 DISALLOW_COPY_AND_ASSIGN(ResourceDispatcherHostImpl);
418 }; 425 };
419 426
420 } // namespace content 427 } // namespace content
421 428
422 #endif // CONTENT_BROWSER_LOADER_RESOURCE_DISPATCHER_HOST_IMPL_H_ 429 #endif // CONTENT_BROWSER_LOADER_RESOURCE_DISPATCHER_HOST_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698