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

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

Issue 10381122: Add flag to specify if explicitly requested download is from web. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Incorporated comments. Created 8 years, 7 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 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 68
69 // Returns the current ResourceDispatcherHostImpl. May return NULL if it 69 // Returns the current ResourceDispatcherHostImpl. May return NULL if it
70 // hasn't been created yet. 70 // hasn't been created yet.
71 static ResourceDispatcherHostImpl* Get(); 71 static ResourceDispatcherHostImpl* Get();
72 72
73 // ResourceDispatcherHost implementation: 73 // ResourceDispatcherHost implementation:
74 virtual void SetDelegate(ResourceDispatcherHostDelegate* delegate) OVERRIDE; 74 virtual void SetDelegate(ResourceDispatcherHostDelegate* delegate) OVERRIDE;
75 virtual void SetAllowCrossOriginAuthPrompt(bool value) OVERRIDE; 75 virtual void SetAllowCrossOriginAuthPrompt(bool value) OVERRIDE;
76 virtual net::Error BeginDownload( 76 virtual net::Error BeginDownload(
77 scoped_ptr<net::URLRequest> request, 77 scoped_ptr<net::URLRequest> request,
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 const DownloadSaveInfo& save_info, 83 const DownloadSaveInfo& save_info,
83 const DownloadStartedCallback& started_callback) OVERRIDE; 84 const DownloadStartedCallback& started_callback) OVERRIDE;
84 virtual void ClearLoginDelegateForRequest(net::URLRequest* request) OVERRIDE; 85 virtual void ClearLoginDelegateForRequest(net::URLRequest* request) OVERRIDE;
85 virtual void MarkAsTransferredNavigation(net::URLRequest* request) OVERRIDE; 86 virtual void MarkAsTransferredNavigation(net::URLRequest* request) OVERRIDE;
86 87
87 // Puts the resource dispatcher host in an inactive state (unable to begin 88 // Puts the resource dispatcher host in an inactive state (unable to begin
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after
249 ResourceDispatcherHostDelegate* delegate() { 250 ResourceDispatcherHostDelegate* delegate() {
250 return delegate_; 251 return delegate_;
251 } 252 }
252 253
253 scoped_refptr<ResourceHandler> CreateResourceHandlerForDownload( 254 scoped_refptr<ResourceHandler> CreateResourceHandlerForDownload(
254 net::URLRequest* request, 255 net::URLRequest* request,
255 ResourceContext* context, 256 ResourceContext* context,
256 int child_id, 257 int child_id,
257 int route_id, 258 int route_id,
258 int request_id, 259 int request_id,
260 bool is_content_initiated,
259 const DownloadSaveInfo& save_info, 261 const DownloadSaveInfo& save_info,
260 const DownloadResourceHandler::OnStartedCallback& started_cb); 262 const DownloadResourceHandler::OnStartedCallback& started_cb);
261 263
262 private: 264 private:
263 FRIEND_TEST_ALL_PREFIXES(ResourceDispatcherHostTest, 265 FRIEND_TEST_ALL_PREFIXES(ResourceDispatcherHostTest,
264 TestBlockedRequestsProcessDies); 266 TestBlockedRequestsProcessDies);
265 FRIEND_TEST_ALL_PREFIXES(ResourceDispatcherHostTest, 267 FRIEND_TEST_ALL_PREFIXES(ResourceDispatcherHostTest,
266 IncrementOutstandingRequestsMemoryCost); 268 IncrementOutstandingRequestsMemoryCost);
267 FRIEND_TEST_ALL_PREFIXES(ResourceDispatcherHostTest, 269 FRIEND_TEST_ALL_PREFIXES(ResourceDispatcherHostTest,
268 CalculateApproximateMemoryCost); 270 CalculateApproximateMemoryCost);
(...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after
515 // http://crbug.com/90971 - Assists in tracking down use-after-frees on 517 // http://crbug.com/90971 - Assists in tracking down use-after-frees on
516 // shutdown. 518 // shutdown.
517 std::set<const ResourceContext*> canceled_resource_contexts_; 519 std::set<const ResourceContext*> canceled_resource_contexts_;
518 520
519 DISALLOW_COPY_AND_ASSIGN(ResourceDispatcherHostImpl); 521 DISALLOW_COPY_AND_ASSIGN(ResourceDispatcherHostImpl);
520 }; 522 };
521 523
522 } // namespace content 524 } // namespace content
523 525
524 #endif // CONTENT_BROWSER_RENDERER_HOST_RESOURCE_DISPATCHER_HOST_IMPL_H_ 526 #endif // CONTENT_BROWSER_RENDERER_HOST_RESOURCE_DISPATCHER_HOST_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698