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 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
81 bool prefer_cache, | 81 bool prefer_cache, |
82 const DownloadSaveInfo& save_info, | 82 const DownloadSaveInfo& save_info, |
83 const DownloadStartedCallback& started_callback) OVERRIDE; | 83 const DownloadStartedCallback& started_callback) OVERRIDE; |
84 virtual void ClearLoginDelegateForRequest(net::URLRequest* request) OVERRIDE; | 84 virtual void ClearLoginDelegateForRequest(net::URLRequest* request) OVERRIDE; |
85 virtual void MarkAsTransferredNavigation(net::URLRequest* request) OVERRIDE; | 85 virtual void MarkAsTransferredNavigation(net::URLRequest* request) OVERRIDE; |
86 | 86 |
87 // Puts the resource dispatcher host in an inactive state (unable to begin | 87 // Puts the resource dispatcher host in an inactive state (unable to begin |
88 // new requests). Cancels all pending requests. | 88 // new requests). Cancels all pending requests. |
89 void Shutdown(); | 89 void Shutdown(); |
90 | 90 |
| 91 // Notify the ResourceDispatcherHostImpl of a new resource context. |
| 92 void AddResourceContext(ResourceContext* context); |
| 93 |
| 94 // Notify the ResourceDispatcherHostImpl of a resource context destruction. |
| 95 void RemoveResourceContext(ResourceContext* context); |
| 96 |
91 // Force cancels any pending requests for the given |context|. This is | 97 // Force cancels any pending requests for the given |context|. This is |
92 // necessary to ensure that before |context| goes away, all requests | 98 // necessary to ensure that before |context| goes away, all requests |
93 // for it are dead. | 99 // for it are dead. |
94 void CancelRequestsForContext(ResourceContext* context); | 100 void CancelRequestsForContext(ResourceContext* context); |
95 | 101 |
96 // Returns true if the message was a resource message that was processed. | 102 // Returns true if the message was a resource message that was processed. |
97 // If it was, message_was_ok will be false iff the message was corrupt. | 103 // If it was, message_was_ok will be false iff the message was corrupt. |
98 bool OnMessageReceived(const IPC::Message& message, | 104 bool OnMessageReceived(const IPC::Message& message, |
99 ResourceMessageFilter* filter, | 105 ResourceMessageFilter* filter, |
100 bool* message_was_ok); | 106 bool* message_was_ok); |
(...skipping 406 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
507 | 513 |
508 bool allow_cross_origin_auth_prompt_; | 514 bool allow_cross_origin_auth_prompt_; |
509 | 515 |
510 // Maps the request ID of request that is being transferred to a new RVH | 516 // Maps the request ID of request that is being transferred to a new RVH |
511 // to the respective request. | 517 // to the respective request. |
512 typedef std::map<GlobalRequestID, net::URLRequest*> TransferredNavigations; | 518 typedef std::map<GlobalRequestID, net::URLRequest*> TransferredNavigations; |
513 TransferredNavigations transferred_navigations_; | 519 TransferredNavigations transferred_navigations_; |
514 | 520 |
515 // http://crbug.com/90971 - Assists in tracking down use-after-frees on | 521 // http://crbug.com/90971 - Assists in tracking down use-after-frees on |
516 // shutdown. | 522 // shutdown. |
517 std::set<const ResourceContext*> canceled_resource_contexts_; | 523 std::set<const ResourceContext*> active_resource_contexts_; |
518 | 524 |
519 DISALLOW_COPY_AND_ASSIGN(ResourceDispatcherHostImpl); | 525 DISALLOW_COPY_AND_ASSIGN(ResourceDispatcherHostImpl); |
520 }; | 526 }; |
521 | 527 |
522 } // namespace content | 528 } // namespace content |
523 | 529 |
524 #endif // CONTENT_BROWSER_RENDERER_HOST_RESOURCE_DISPATCHER_HOST_IMPL_H_ | 530 #endif // CONTENT_BROWSER_RENDERER_HOST_RESOURCE_DISPATCHER_HOST_IMPL_H_ |
OLD | NEW |