OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 RenderProcessHosts, and dispatches them to URLRequests. It then | 6 // from the RenderProcessHosts, and dispatches them to URLRequests. It then |
7 // fowards the messages from the URLRequests back to the correct process for | 7 // fowards the messages from the URLRequests back to the correct process for |
8 // handling. | 8 // handling. |
9 // | 9 // |
10 // See http://wiki.corp.google.com/twiki/bin/view/Main/ChromeMultiProcessResourc
eLoading | 10 // See http://wiki.corp.google.com/twiki/bin/view/Main/ChromeMultiProcessResourc
eLoading |
(...skipping 396 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
407 // mechanism. We should also consider a hashtable or binary tree if it turns | 407 // mechanism. We should also consider a hashtable or binary tree if it turns |
408 // out we have a lot of things here. | 408 // out we have a lot of things here. |
409 typedef std::map<GlobalRequestID,URLRequest*> PendingRequestList; | 409 typedef std::map<GlobalRequestID,URLRequest*> PendingRequestList; |
410 | 410 |
411 // A test to determining whether a given request should be forwarded to the | 411 // A test to determining whether a given request should be forwarded to the |
412 // download thread. | 412 // download thread. |
413 bool ShouldDownload(const std::string& mime_type, | 413 bool ShouldDownload(const std::string& mime_type, |
414 const std::string& content_disposition); | 414 const std::string& content_disposition); |
415 | 415 |
416 void RemovePendingRequest(int render_process_host_id, int request_id); | 416 void RemovePendingRequest(int render_process_host_id, int request_id); |
417 void RemovePendingRequest(PendingRequestList::iterator& iter); | 417 // Deletes the pending request identified by the iterator passed in. |
| 418 // This function will invalidate the iterator passed in. Callers should |
| 419 // not rely on this iterator being valid on return. |
| 420 void RemovePendingRequest(const PendingRequestList::iterator& iter); |
418 | 421 |
419 // Notify our observers that we started receiving a response for a request. | 422 // Notify our observers that we started receiving a response for a request. |
420 void NotifyResponseStarted(URLRequest* request, int render_process_host_id); | 423 void NotifyResponseStarted(URLRequest* request, int render_process_host_id); |
421 | 424 |
422 // Notify our observers that a request has been cancelled. | 425 // Notify our observers that a request has been cancelled. |
423 void NotifyResponseCompleted(URLRequest* request, int render_process_host_id); | 426 void NotifyResponseCompleted(URLRequest* request, int render_process_host_id); |
424 | 427 |
425 // Notify our observers that a request has been redirected. | 428 // Notify our observers that a request has been redirected. |
426 void NofityReceivedRedirect(URLRequest* request, | 429 void NofityReceivedRedirect(URLRequest* request, |
427 int render_process_host_id, | 430 int render_process_host_id, |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
481 // For running tasks. | 484 // For running tasks. |
482 ScopedRunnableMethodFactory<ResourceDispatcherHost> method_runner_; | 485 ScopedRunnableMethodFactory<ResourceDispatcherHost> method_runner_; |
483 | 486 |
484 // True if the resource dispatcher host has been shut down. | 487 // True if the resource dispatcher host has been shut down. |
485 bool is_shutdown_; | 488 bool is_shutdown_; |
486 | 489 |
487 DISALLOW_EVIL_CONSTRUCTORS(ResourceDispatcherHost); | 490 DISALLOW_EVIL_CONSTRUCTORS(ResourceDispatcherHost); |
488 }; | 491 }; |
489 | 492 |
490 #endif // CHROME_BROWSER_RESOURCE_DISPATCHER_HOST_H__ | 493 #endif // CHROME_BROWSER_RESOURCE_DISPATCHER_HOST_H__ |
OLD | NEW |