| 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 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 158 | 158 |
| 159 // The average private bytes increase of the browser for each new pending | 159 // The average private bytes increase of the browser for each new pending |
| 160 // request. Experimentally obtained. | 160 // request. Experimentally obtained. |
| 161 static const int kAvgBytesPerOutstandingRequest = 4400; | 161 static const int kAvgBytesPerOutstandingRequest = 4400; |
| 162 | 162 |
| 163 SaveFileManager* save_file_manager() const { | 163 SaveFileManager* save_file_manager() const { |
| 164 return save_file_manager_.get(); | 164 return save_file_manager_.get(); |
| 165 } | 165 } |
| 166 | 166 |
| 167 // Called when a RenderViewHost is created. | 167 // Called when a RenderViewHost is created. |
| 168 void OnRenderViewHostCreated(int child_id, int route_id, bool is_visible); | 168 void OnRenderViewHostCreated(int child_id, |
| 169 int route_id, |
| 170 bool is_visible, |
| 171 bool is_audible); |
| 169 | 172 |
| 170 // Called when a RenderViewHost is deleted. | 173 // Called when a RenderViewHost is deleted. |
| 171 void OnRenderViewHostDeleted(int child_id, int route_id); | 174 void OnRenderViewHostDeleted(int child_id, int route_id); |
| 172 | 175 |
| 173 // Called when a RenderViewHost starts or stops loading. | 176 // Called when a RenderViewHost starts or stops loading. |
| 174 void OnRenderViewHostSetIsLoading(int child_id, | 177 void OnRenderViewHostSetIsLoading(int child_id, |
| 175 int route_id, | 178 int route_id, |
| 176 bool is_loading); | 179 bool is_loading); |
| 177 | 180 |
| 178 // Called when a RenderViewHost is hidden. | 181 // Called when a RenderViewHost is hidden. |
| 179 void OnRenderViewHostWasHidden(int child_id, int route_id); | 182 void OnRenderViewHostWasHidden(int child_id, int route_id); |
| 180 | 183 |
| 181 // Called when a RenderViewHost is shown. | 184 // Called when a RenderViewHost is shown. |
| 182 void OnRenderViewHostWasShown(int child_id, int route_id); | 185 void OnRenderViewHostWasShown(int child_id, int route_id); |
| 183 | 186 |
| 187 // Called when an AudioRenderHost starts or stops playing. |
| 188 void OnAudioRenderHostStreamStateChanged(int child_id, |
| 189 int route_id, |
| 190 bool is_playing); |
| 191 |
| 184 // Force cancels any pending requests for the given process. | 192 // Force cancels any pending requests for the given process. |
| 185 void CancelRequestsForProcess(int child_id); | 193 void CancelRequestsForProcess(int child_id); |
| 186 | 194 |
| 187 void OnUserGesture(WebContentsImpl* contents); | 195 void OnUserGesture(WebContentsImpl* contents); |
| 188 | 196 |
| 189 // Retrieves a net::URLRequest. Must be called from the IO thread. | 197 // Retrieves a net::URLRequest. Must be called from the IO thread. |
| 190 net::URLRequest* GetURLRequest(const GlobalRequestID& request_id); | 198 net::URLRequest* GetURLRequest(const GlobalRequestID& request_id); |
| 191 | 199 |
| 192 void RemovePendingRequest(int child_id, int request_id); | 200 void RemovePendingRequest(int child_id, int request_id); |
| 193 | 201 |
| (...skipping 342 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 536 DelegateMap delegate_map_; | 544 DelegateMap delegate_map_; |
| 537 | 545 |
| 538 scoped_ptr<ResourceScheduler> scheduler_; | 546 scoped_ptr<ResourceScheduler> scheduler_; |
| 539 | 547 |
| 540 DISALLOW_COPY_AND_ASSIGN(ResourceDispatcherHostImpl); | 548 DISALLOW_COPY_AND_ASSIGN(ResourceDispatcherHostImpl); |
| 541 }; | 549 }; |
| 542 | 550 |
| 543 } // namespace content | 551 } // namespace content |
| 544 | 552 |
| 545 #endif // CONTENT_BROWSER_LOADER_RESOURCE_DISPATCHER_HOST_IMPL_H_ | 553 #endif // CONTENT_BROWSER_LOADER_RESOURCE_DISPATCHER_HOST_IMPL_H_ |
| OLD | NEW |