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

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

Issue 12321055: Revert 183382 (Closed) Base URL: svn://svn.chromium.org/chrome/branches/1418/src/
Patch Set: Created 7 years, 10 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
« no previous file with comments | « no previous file | content/browser/loader/resource_dispatcher_host_impl.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
11 11
12 #ifndef CONTENT_BROWSER_LOADER_RESOURCE_DISPATCHER_HOST_IMPL_H_ 12 #ifndef CONTENT_BROWSER_LOADER_RESOURCE_DISPATCHER_HOST_IMPL_H_
13 #define CONTENT_BROWSER_LOADER_RESOURCE_DISPATCHER_HOST_IMPL_H_ 13 #define CONTENT_BROWSER_LOADER_RESOURCE_DISPATCHER_HOST_IMPL_H_
14 14
15 #include <map> 15 #include <map>
16 #include <set> 16 #include <set>
17 #include <string> 17 #include <string>
18 #include <vector> 18 #include <vector>
19 19
20 #include "base/basictypes.h" 20 #include "base/basictypes.h"
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/observer_list.h" 24 #include "base/observer_list.h"
25 #include "base/time.h" 25 #include "base/time.h"
26 #include "base/timer.h" 26 #include "base/timer.h"
27 #include "content/browser/download/download_resource_handler.h" 27 #include "content/browser/download/download_resource_handler.h"
28 #include "content/browser/loader/resource_loader.h" 28 #include "content/browser/loader/resource_loader.h"
29 #include "content/browser/loader/resource_loader_delegate.h" 29 #include "content/browser/loader/resource_loader_delegate.h"
30 #include "content/browser/loader/resource_scheduler.h"
31 #include "content/common/content_export.h" 30 #include "content/common/content_export.h"
32 #include "content/public/browser/child_process_data.h" 31 #include "content/public/browser/child_process_data.h"
33 #include "content/public/browser/download_id.h" 32 #include "content/public/browser/download_id.h"
34 #include "content/public/browser/notification_types.h" 33 #include "content/public/browser/notification_types.h"
35 #include "content/public/browser/resource_dispatcher_host.h" 34 #include "content/public/browser/resource_dispatcher_host.h"
36 #include "ipc/ipc_message.h" 35 #include "ipc/ipc_message.h"
37 #include "net/cookies/canonical_cookie.h" 36 #include "net/cookies/canonical_cookie.h"
38 #include "net/url_request/url_request.h" 37 #include "net/url_request/url_request.h"
39 #include "webkit/glue/resource_type.h" 38 #include "webkit/glue/resource_type.h"
40 39
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after
211 scoped_ptr<ResourceHandler> CreateResourceHandlerForDownload( 210 scoped_ptr<ResourceHandler> CreateResourceHandlerForDownload(
212 net::URLRequest* request, 211 net::URLRequest* request,
213 bool is_content_initiated, 212 bool is_content_initiated,
214 bool must_download, 213 bool must_download,
215 DownloadId id, 214 DownloadId id,
216 scoped_ptr<DownloadSaveInfo> save_info, 215 scoped_ptr<DownloadSaveInfo> save_info,
217 const DownloadResourceHandler::OnStartedCallback& started_cb); 216 const DownloadResourceHandler::OnStartedCallback& started_cb);
218 217
219 void ClearSSLClientAuthHandlerForRequest(net::URLRequest* request); 218 void ClearSSLClientAuthHandlerForRequest(net::URLRequest* request);
220 219
221 ResourceScheduler* scheduler() { return scheduler_.get(); }
222
223 private: 220 private:
224 FRIEND_TEST_ALL_PREFIXES(ResourceDispatcherHostTest, 221 FRIEND_TEST_ALL_PREFIXES(ResourceDispatcherHostTest,
225 TestBlockedRequestsProcessDies); 222 TestBlockedRequestsProcessDies);
226 FRIEND_TEST_ALL_PREFIXES(ResourceDispatcherHostTest, 223 FRIEND_TEST_ALL_PREFIXES(ResourceDispatcherHostTest,
227 IncrementOutstandingRequestsMemoryCost); 224 IncrementOutstandingRequestsMemoryCost);
228 FRIEND_TEST_ALL_PREFIXES(ResourceDispatcherHostTest, 225 FRIEND_TEST_ALL_PREFIXES(ResourceDispatcherHostTest,
229 CalculateApproximateMemoryCost); 226 CalculateApproximateMemoryCost);
230 227
231 class ShutdownTask; 228 class ShutdownTask;
232 229
(...skipping 19 matching lines...) Expand all
252 virtual void DidFinishLoading(ResourceLoader* loader) OVERRIDE; 249 virtual void DidFinishLoading(ResourceLoader* loader) OVERRIDE;
253 250
254 // Extracts the render view/process host's identifiers from the given request 251 // Extracts the render view/process host's identifiers from the given request
255 // and places them in the given out params (both required). If there are no 252 // and places them in the given out params (both required). If there are no
256 // such IDs associated with the request (such as non-page-related requests), 253 // such IDs associated with the request (such as non-page-related requests),
257 // this function will return false and both out params will be -1. 254 // this function will return false and both out params will be -1.
258 static bool RenderViewForRequest(const net::URLRequest* request, 255 static bool RenderViewForRequest(const net::URLRequest* request,
259 int* render_process_host_id, 256 int* render_process_host_id,
260 int* render_view_host_id); 257 int* render_view_host_id);
261 258
262 // An init helper that runs on the IO thread.
263 void OnInit();
264
265 // A shutdown helper that runs on the IO thread. 259 // A shutdown helper that runs on the IO thread.
266 void OnShutdown(); 260 void OnShutdown();
267 261
268 // The real implementation of the OnSwapOutACK logic. OnSwapOutACK and 262 // The real implementation of the OnSwapOutACK logic. OnSwapOutACK and
269 // OnSimulateSwapOutACK just call this method, supplying the |timed_out| 263 // OnSimulateSwapOutACK just call this method, supplying the |timed_out|
270 // parameter, which indicates whether the call is due to a timeout while 264 // parameter, which indicates whether the call is due to a timeout while
271 // waiting for SwapOut acknowledgement from the renderer process. 265 // waiting for SwapOut acknowledgement from the renderer process.
272 void HandleSwapOutACK(const ViewMsg_SwapOut_Params& params, bool timed_out); 266 void HandleSwapOutACK(const ViewMsg_SwapOut_Params& params, bool timed_out);
273 267
274 // Helper function for regular and download requests. 268 // Helper function for regular and download requests.
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after
428 bool allow_cross_origin_auth_prompt_; 422 bool allow_cross_origin_auth_prompt_;
429 423
430 // http://crbug.com/90971 - Assists in tracking down use-after-frees on 424 // http://crbug.com/90971 - Assists in tracking down use-after-frees on
431 // shutdown. 425 // shutdown.
432 std::set<const ResourceContext*> active_resource_contexts_; 426 std::set<const ResourceContext*> active_resource_contexts_;
433 427
434 typedef std::map<GlobalRequestID, 428 typedef std::map<GlobalRequestID,
435 ObserverList<ResourceMessageDelegate>*> DelegateMap; 429 ObserverList<ResourceMessageDelegate>*> DelegateMap;
436 DelegateMap delegate_map_; 430 DelegateMap delegate_map_;
437 431
438 scoped_ptr<ResourceScheduler> scheduler_;
439
440 DISALLOW_COPY_AND_ASSIGN(ResourceDispatcherHostImpl); 432 DISALLOW_COPY_AND_ASSIGN(ResourceDispatcherHostImpl);
441 }; 433 };
442 434
443 } // namespace content 435 } // namespace content
444 436
445 #endif // CONTENT_BROWSER_LOADER_RESOURCE_DISPATCHER_HOST_IMPL_H_ 437 #endif // CONTENT_BROWSER_LOADER_RESOURCE_DISPATCHER_HOST_IMPL_H_
OLDNEW
« no previous file with comments | « no previous file | content/browser/loader/resource_dispatcher_host_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698