OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 // Puts the resource dispatcher host in an inactive state (unable to begin | 70 // Puts the resource dispatcher host in an inactive state (unable to begin |
71 // new requests). Cancels all pending requests. | 71 // new requests). Cancels all pending requests. |
72 void Shutdown(); | 72 void Shutdown(); |
73 | 73 |
74 // Returns true if the message was a resource message that was processed. | 74 // Returns true if the message was a resource message that was processed. |
75 // If it was, message_was_ok will be false iff the message was corrupt. | 75 // If it was, message_was_ok will be false iff the message was corrupt. |
76 bool OnMessageReceived(const IPC::Message& message, | 76 bool OnMessageReceived(const IPC::Message& message, |
77 ResourceMessageFilter* filter, | 77 ResourceMessageFilter* filter, |
78 bool* message_was_ok); | 78 bool* message_was_ok); |
79 | 79 |
80 // Initiates a download from the browser process (as opposed to a resource | 80 // Initiates a download by explicit request of the renderer, e.g. due to |
81 // request from the renderer or another child process). | 81 // alt-clicking a link. |
82 void BeginDownload(const GURL& url, | 82 void BeginDownload(const GURL& url, |
83 const GURL& referrer, | 83 const GURL& referrer, |
84 const DownloadSaveInfo& save_info, | 84 const DownloadSaveInfo& save_info, |
85 bool prompt_for_save_location, | 85 bool prompt_for_save_location, |
86 int process_unique_id, | 86 int process_unique_id, |
87 int route_id, | 87 int route_id, |
88 const content::ResourceContext& context); | 88 const content::ResourceContext& context); |
89 | 89 |
90 // Initiates a save file from the browser process (as opposed to a resource | 90 // Initiates a save file from the browser process (as opposed to a resource |
91 // request from the renderer or another child process). | 91 // request from the renderer or another child process). |
(...skipping 301 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
393 int route_id); // only valid for async | 393 int route_id); // only valid for async |
394 void OnDataReceivedACK(int request_id); | 394 void OnDataReceivedACK(int request_id); |
395 void OnDataDownloadedACK(int request_id); | 395 void OnDataDownloadedACK(int request_id); |
396 void OnUploadProgressACK(int request_id); | 396 void OnUploadProgressACK(int request_id); |
397 void OnCancelRequest(int request_id); | 397 void OnCancelRequest(int request_id); |
398 void OnFollowRedirect(int request_id, | 398 void OnFollowRedirect(int request_id, |
399 bool has_new_first_party_for_cookies, | 399 bool has_new_first_party_for_cookies, |
400 const GURL& new_first_party_for_cookies); | 400 const GURL& new_first_party_for_cookies); |
401 void OnReleaseDownloadedFile(int request_id); | 401 void OnReleaseDownloadedFile(int request_id); |
402 | 402 |
403 // Creates ResourceDispatcherHostRequestInfo for a browser-initiated request | 403 // Creates ResourceDispatcherHostRequestInfo for a download or page save. |
404 // (a download or a page save). |download| should be true if the request | 404 // |download| should be true if the request is a file download. |
405 // is a file download. | 405 ResourceDispatcherHostRequestInfo* CreateRequestInfo( |
406 ResourceDispatcherHostRequestInfo* CreateRequestInfoForBrowserRequest( | |
407 ResourceHandler* handler, | 406 ResourceHandler* handler, |
408 int child_id, | 407 int child_id, |
409 int route_id, | 408 int route_id, |
410 bool download, | 409 bool download, |
411 const content::ResourceContext& context); | 410 const content::ResourceContext& context); |
412 | 411 |
413 // Returns true if |request| is in |pending_requests_|. | 412 // Returns true if |request| is in |pending_requests_|. |
414 bool IsValidRequest(net::URLRequest* request); | 413 bool IsValidRequest(net::URLRequest* request); |
415 | 414 |
416 // Determine request priority based on how critical this resource typically | 415 // Determine request priority based on how critical this resource typically |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
509 | 508 |
510 ResourceDispatcherHostDelegate* delegate_; | 509 ResourceDispatcherHostDelegate* delegate_; |
511 | 510 |
512 static bool is_prefetch_enabled_; | 511 static bool is_prefetch_enabled_; |
513 bool allow_cross_origin_auth_prompt_; | 512 bool allow_cross_origin_auth_prompt_; |
514 | 513 |
515 DISALLOW_COPY_AND_ASSIGN(ResourceDispatcherHost); | 514 DISALLOW_COPY_AND_ASSIGN(ResourceDispatcherHost); |
516 }; | 515 }; |
517 | 516 |
518 #endif // CONTENT_BROWSER_RENDERER_HOST_RESOURCE_DISPATCHER_HOST_H_ | 517 #endif // CONTENT_BROWSER_RENDERER_HOST_RESOURCE_DISPATCHER_HOST_H_ |
OLD | NEW |