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 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
157 | 157 |
158 // The average private bytes increase of the browser for each new pending | 158 // The average private bytes increase of the browser for each new pending |
159 // request. Experimentally obtained. | 159 // request. Experimentally obtained. |
160 static const int kAvgBytesPerOutstandingRequest = 4400; | 160 static const int kAvgBytesPerOutstandingRequest = 4400; |
161 | 161 |
162 SaveFileManager* save_file_manager() const { | 162 SaveFileManager* save_file_manager() const { |
163 return save_file_manager_.get(); | 163 return save_file_manager_.get(); |
164 } | 164 } |
165 | 165 |
166 // Called when a RenderViewHost is created. | 166 // Called when a RenderViewHost is created. |
167 void OnRenderViewHostCreated(int child_id, int route_id); | 167 void OnRenderViewHostCreated(int child_id, int route_id, bool is_visible); |
168 | 168 |
169 // Called when a RenderViewHost is deleted. | 169 // Called when a RenderViewHost is deleted. |
170 void OnRenderViewHostDeleted(int child_id, int route_id); | 170 void OnRenderViewHostDeleted(int child_id, int route_id); |
171 | 171 |
| 172 // Called when a RenderViewHost is hidden. |
| 173 void OnRenderViewHostWasHidden(int child_id, int route_id); |
| 174 |
| 175 // Called when a RenderViewHost is shown. |
| 176 void OnRenderViewHostWasShown(int child_id, int route_id); |
| 177 |
172 // Force cancels any pending requests for the given process. | 178 // Force cancels any pending requests for the given process. |
173 void CancelRequestsForProcess(int child_id); | 179 void CancelRequestsForProcess(int child_id); |
174 | 180 |
175 void OnUserGesture(WebContentsImpl* contents); | 181 void OnUserGesture(WebContentsImpl* contents); |
176 | 182 |
177 // Retrieves a net::URLRequest. Must be called from the IO thread. | 183 // Retrieves a net::URLRequest. Must be called from the IO thread. |
178 net::URLRequest* GetURLRequest(const GlobalRequestID& request_id); | 184 net::URLRequest* GetURLRequest(const GlobalRequestID& request_id); |
179 | 185 |
180 void RemovePendingRequest(int child_id, int request_id); | 186 void RemovePendingRequest(int child_id, int request_id); |
181 | 187 |
(...skipping 334 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
516 DelegateMap delegate_map_; | 522 DelegateMap delegate_map_; |
517 | 523 |
518 scoped_ptr<ResourceScheduler> scheduler_; | 524 scoped_ptr<ResourceScheduler> scheduler_; |
519 | 525 |
520 DISALLOW_COPY_AND_ASSIGN(ResourceDispatcherHostImpl); | 526 DISALLOW_COPY_AND_ASSIGN(ResourceDispatcherHostImpl); |
521 }; | 527 }; |
522 | 528 |
523 } // namespace content | 529 } // namespace content |
524 | 530 |
525 #endif // CONTENT_BROWSER_LOADER_RESOURCE_DISPATCHER_HOST_IMPL_H_ | 531 #endif // CONTENT_BROWSER_LOADER_RESOURCE_DISPATCHER_HOST_IMPL_H_ |
OLD | NEW |