| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 fowards the messages from the | 7 // dispatches them to URLRequests. It then fowards 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 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 136 URLRequestContext* request_context); | 136 URLRequestContext* request_context); |
| 137 | 137 |
| 138 // Cancels the given request if it still exists. We ignore cancels from the | 138 // Cancels the given request if it still exists. We ignore cancels from the |
| 139 // renderer in the event of a download. | 139 // renderer in the event of a download. |
| 140 void CancelRequest(int process_unique_id, | 140 void CancelRequest(int process_unique_id, |
| 141 int request_id, | 141 int request_id, |
| 142 bool from_renderer); | 142 bool from_renderer); |
| 143 | 143 |
| 144 // Follows a deferred redirect for the given request. | 144 // Follows a deferred redirect for the given request. |
| 145 // new_first_party_for_cookies, if non-empty, is the new cookie policy URL | 145 // new_first_party_for_cookies, if non-empty, is the new cookie policy URL |
| 146 // for the redirected URL. Pass an empty, invalid URL as | 146 // for the redirected URL. If the cookie policy URL needs changing, pass |
| 147 // new_first_party_for_cookies to indicate that the cookie policy URL | 147 // true as has_new_first_party_for_cookies and the new cookie policy URL as |
| 148 // doesn't need changing. | 148 // new_first_party_for_cookies. Otherwise, pass false as |
| 149 // has_new_first_party_for_cookies, and new_first_party_for_cookies will not |
| 150 // be used. |
| 149 void FollowDeferredRedirect(int process_unique_id, | 151 void FollowDeferredRedirect(int process_unique_id, |
| 150 int request_id, | 152 int request_id, |
| 153 bool has_new_first_party_for_cookies, |
| 151 const GURL& new_first_party_for_cookies); | 154 const GURL& new_first_party_for_cookies); |
| 152 | 155 |
| 153 // Returns true if it's ok to send the data. If there are already too many | 156 // Returns true if it's ok to send the data. If there are already too many |
| 154 // data messages pending, it pauses the request and returns false. In this | 157 // data messages pending, it pauses the request and returns false. In this |
| 155 // case the caller should not send the data. | 158 // case the caller should not send the data. |
| 156 bool WillSendData(int process_unique_id, int request_id); | 159 bool WillSendData(int process_unique_id, int request_id); |
| 157 | 160 |
| 158 // Pauses or resumes network activity for a particular request. | 161 // Pauses or resumes network activity for a particular request. |
| 159 void PauseRequest(int process_unique_id, int request_id, bool pause); | 162 void PauseRequest(int process_unique_id, int request_id, bool pause); |
| 160 | 163 |
| (...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 399 const ViewHostMsg_Resource_Request& request_data, | 402 const ViewHostMsg_Resource_Request& request_data, |
| 400 IPC::Message* sync_result); | 403 IPC::Message* sync_result); |
| 401 void BeginRequest(int request_id, | 404 void BeginRequest(int request_id, |
| 402 const ViewHostMsg_Resource_Request& request_data, | 405 const ViewHostMsg_Resource_Request& request_data, |
| 403 IPC::Message* sync_result, // only valid for sync | 406 IPC::Message* sync_result, // only valid for sync |
| 404 int route_id); // only valid for async | 407 int route_id); // only valid for async |
| 405 void OnDataReceivedACK(int request_id); | 408 void OnDataReceivedACK(int request_id); |
| 406 void OnUploadProgressACK(int request_id); | 409 void OnUploadProgressACK(int request_id); |
| 407 void OnCancelRequest(int request_id); | 410 void OnCancelRequest(int request_id); |
| 408 void OnFollowRedirect(int request_id, | 411 void OnFollowRedirect(int request_id, |
| 412 bool has_new_first_party_for_cookies, |
| 409 const GURL& new_first_party_for_cookies); | 413 const GURL& new_first_party_for_cookies); |
| 410 | 414 |
| 411 // Returns true if the message passed in is a resource related message. | 415 // Returns true if the message passed in is a resource related message. |
| 412 static bool IsResourceDispatcherHostMessage(const IPC::Message&); | 416 static bool IsResourceDispatcherHostMessage(const IPC::Message&); |
| 413 | 417 |
| 414 PendingRequestList pending_requests_; | 418 PendingRequestList pending_requests_; |
| 415 | 419 |
| 416 // A timer that periodically calls UpdateLoadStates while pending_requests_ | 420 // A timer that periodically calls UpdateLoadStates while pending_requests_ |
| 417 // is not empty. | 421 // is not empty. |
| 418 base::RepeatingTimer<ResourceDispatcherHost> update_load_states_timer_; | 422 base::RepeatingTimer<ResourceDispatcherHost> update_load_states_timer_; |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 476 | 480 |
| 477 // Keeps track of elements blocked by the Privacy Blacklist. | 481 // Keeps track of elements blocked by the Privacy Blacklist. |
| 478 chrome::BlockedResponse blocked_; | 482 chrome::BlockedResponse blocked_; |
| 479 | 483 |
| 480 static bool g_is_http_prioritization_enabled; | 484 static bool g_is_http_prioritization_enabled; |
| 481 | 485 |
| 482 DISALLOW_COPY_AND_ASSIGN(ResourceDispatcherHost); | 486 DISALLOW_COPY_AND_ASSIGN(ResourceDispatcherHost); |
| 483 }; | 487 }; |
| 484 | 488 |
| 485 #endif // CHROME_BROWSER_RENDERER_HOST_RESOURCE_DISPATCHER_HOST_H_ | 489 #endif // CHROME_BROWSER_RENDERER_HOST_RESOURCE_DISPATCHER_HOST_H_ |
| OLD | NEW |