| 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 378 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 389 | 389 |
| 390 // Internal function to finish an async IO which has completed. Returns | 390 // Internal function to finish an async IO which has completed. Returns |
| 391 // true if there is more data to read (e.g. we haven't read EOF yet and | 391 // true if there is more data to read (e.g. we haven't read EOF yet and |
| 392 // no errors have occurred). | 392 // no errors have occurred). |
| 393 bool CompleteRead(URLRequest *, int* bytes_read); | 393 bool CompleteRead(URLRequest *, int* bytes_read); |
| 394 | 394 |
| 395 // Internal function to finish handling the ResponseStarted message. Returns | 395 // Internal function to finish handling the ResponseStarted message. Returns |
| 396 // true on success. | 396 // true on success. |
| 397 bool CompleteResponseStarted(URLRequest* request); | 397 bool CompleteResponseStarted(URLRequest* request); |
| 398 | 398 |
| 399 // Cancels the given request if it still exists. We ignore cancels from the |
| 400 // renderer in the event of a download. If |allow_delete| is true and no IO |
| 401 // is pending, the request is removed and deleted. |
| 402 void CancelRequest(int render_process_host_id, |
| 403 int request_id, |
| 404 bool from_renderer, |
| 405 bool allow_delete); |
| 406 |
| 399 // Helper function for regular and download requests. | 407 // Helper function for regular and download requests. |
| 400 void BeginRequestInternal(URLRequest* request, bool mixed_content); | 408 void BeginRequestInternal(URLRequest* request, bool mixed_content); |
| 401 | 409 |
| 402 // The list of all requests that we have pending. This list is not really | 410 // The list of all requests that we have pending. This list is not really |
| 403 // optimized, and assumes that we have relatively few requests pending at once | 411 // optimized, and assumes that we have relatively few requests pending at once |
| 404 // since some operations require brute-force searching of the list. | 412 // since some operations require brute-force searching of the list. |
| 405 // | 413 // |
| 406 // It may be enhanced in the future to provide some kind of prioritization | 414 // It may be enhanced in the future to provide some kind of prioritization |
| 407 // mechanism. We should also consider a hashtable or binary tree if it turns | 415 // mechanism. We should also consider a hashtable or binary tree if it turns |
| 408 // out we have a lot of things here. | 416 // out we have a lot of things here. |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 484 // For running tasks. | 492 // For running tasks. |
| 485 ScopedRunnableMethodFactory<ResourceDispatcherHost> method_runner_; | 493 ScopedRunnableMethodFactory<ResourceDispatcherHost> method_runner_; |
| 486 | 494 |
| 487 // True if the resource dispatcher host has been shut down. | 495 // True if the resource dispatcher host has been shut down. |
| 488 bool is_shutdown_; | 496 bool is_shutdown_; |
| 489 | 497 |
| 490 DISALLOW_EVIL_CONSTRUCTORS(ResourceDispatcherHost); | 498 DISALLOW_EVIL_CONSTRUCTORS(ResourceDispatcherHost); |
| 491 }; | 499 }; |
| 492 | 500 |
| 493 #endif // CHROME_BROWSER_RESOURCE_DISPATCHER_HOST_H__ | 501 #endif // CHROME_BROWSER_RESOURCE_DISPATCHER_HOST_H__ |
| OLD | NEW |