OLD | NEW |
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 290 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
301 | 301 |
302 // Called when loading a request with mojo. | 302 // Called when loading a request with mojo. |
303 void OnRequestResourceWithMojo( | 303 void OnRequestResourceWithMojo( |
304 int routing_id, | 304 int routing_id, |
305 int request_id, | 305 int request_id, |
306 const ResourceRequest& request, | 306 const ResourceRequest& request, |
307 mojo::InterfaceRequest<mojom::URLLoader> mojo_request, | 307 mojo::InterfaceRequest<mojom::URLLoader> mojo_request, |
308 mojom::URLLoaderClientPtr url_loader_client, | 308 mojom::URLLoaderClientPtr url_loader_client, |
309 ResourceMessageFilter* filter); | 309 ResourceMessageFilter* filter); |
310 | 310 |
| 311 void OnSyncLoadWithMojo(int routing_id, |
| 312 int request_id, |
| 313 const ResourceRequest& request_data, |
| 314 ResourceMessageFilter* filter, |
| 315 const SyncLoadResultCallback& result_handler); |
| 316 |
311 // Helper function for initializing the |request| passed in. By initializing | 317 // Helper function for initializing the |request| passed in. By initializing |
312 // we mean setting the |referrer| on the |request|, associating the | 318 // we mean setting the |referrer| on the |request|, associating the |
313 // ResourceRequestInfoImpl structure with the |request|, etc. | 319 // ResourceRequestInfoImpl structure with the |request|, etc. |
314 // This function should be called for invoking the BeginURLRequest() function | 320 // This function should be called for invoking the BeginURLRequest() function |
315 // to initiate a URL request. | 321 // to initiate a URL request. |
316 void InitializeURLRequest(net::URLRequest* request, | 322 void InitializeURLRequest(net::URLRequest* request, |
317 const Referrer& referrer, | 323 const Referrer& referrer, |
318 bool is_download, | 324 bool is_download, |
319 int render_process_host_id, | 325 int render_process_host_id, |
320 int render_view_routing_id, | 326 int render_view_routing_id, |
(...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
536 void UpdateRequestForTransfer(int child_id, | 542 void UpdateRequestForTransfer(int child_id, |
537 int route_id, | 543 int route_id, |
538 int request_id, | 544 int request_id, |
539 const ResourceRequest& request_data, | 545 const ResourceRequest& request_data, |
540 LoaderMap::iterator iter); | 546 LoaderMap::iterator iter); |
541 | 547 |
542 void BeginRequest( | 548 void BeginRequest( |
543 int request_id, | 549 int request_id, |
544 const ResourceRequest& request_data, | 550 const ResourceRequest& request_data, |
545 const SyncLoadResultCallback& sync_result_handler, // only valid for sync | 551 const SyncLoadResultCallback& sync_result_handler, // only valid for sync |
546 int route_id, // only valid for async | 552 int route_id, |
547 mojo::InterfaceRequest<mojom::URLLoader> mojo_request, | 553 mojo::InterfaceRequest<mojom::URLLoader> mojo_request, |
548 mojom::URLLoaderClientPtr url_loader_client); | 554 mojom::URLLoaderClientPtr url_loader_client); |
549 | 555 |
550 // There are requests which need decisions to be made like the following: | 556 // There are requests which need decisions to be made like the following: |
551 // Whether the presence of certain HTTP headers like the Origin header are | 557 // Whether the presence of certain HTTP headers like the Origin header are |
552 // valid, etc. These requests may need to be aborted based on these | 558 // valid, etc. These requests may need to be aborted based on these |
553 // decisions which could be time consuming. We allow for these decisions | 559 // decisions which could be time consuming. We allow for these decisions |
554 // to be made asynchronously. The request proceeds when we hear back from | 560 // to be made asynchronously. The request proceeds when we hear back from |
555 // the interceptors about whether to continue or not. | 561 // the interceptors about whether to continue or not. |
556 // The |continue_request| parameter in the function indicates whether the | 562 // The |continue_request| parameter in the function indicates whether the |
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
757 | 763 |
758 // Points to the registered download handler intercept. | 764 // Points to the registered download handler intercept. |
759 CreateDownloadHandlerIntercept create_download_handler_intercept_; | 765 CreateDownloadHandlerIntercept create_download_handler_intercept_; |
760 | 766 |
761 DISALLOW_COPY_AND_ASSIGN(ResourceDispatcherHostImpl); | 767 DISALLOW_COPY_AND_ASSIGN(ResourceDispatcherHostImpl); |
762 }; | 768 }; |
763 | 769 |
764 } // namespace content | 770 } // namespace content |
765 | 771 |
766 #endif // CONTENT_BROWSER_LOADER_RESOURCE_DISPATCHER_HOST_IMPL_H_ | 772 #endif // CONTENT_BROWSER_LOADER_RESOURCE_DISPATCHER_HOST_IMPL_H_ |
OLD | NEW |