| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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 // Represents the browser side of the browser <--> renderer communication | 5 // Represents the browser side of the browser <--> renderer communication |
| 6 // channel. There will be one RenderProcessHost per renderer process. | 6 // channel. There will be one RenderProcessHost per renderer process. |
| 7 | 7 |
| 8 #include "content/browser/renderer_host/render_process_host_impl.h" | 8 #include "content/browser/renderer_host/render_process_host_impl.h" |
| 9 | 9 |
| 10 #include <algorithm> | 10 #include <algorithm> |
| (...skipping 2202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2213 void RenderProcessHostImpl::OnShutdownRequest() { | 2213 void RenderProcessHostImpl::OnShutdownRequest() { |
| 2214 // Don't shut down if there are active RenderViews, or if there are pending | 2214 // Don't shut down if there are active RenderViews, or if there are pending |
| 2215 // RenderViews being swapped back in. | 2215 // RenderViews being swapped back in. |
| 2216 // In single process mode, we never shutdown the renderer. | 2216 // In single process mode, we never shutdown the renderer. |
| 2217 int num_active_views = GetActiveViewCount(); | 2217 int num_active_views = GetActiveViewCount(); |
| 2218 if (pending_views_ || num_active_views > 0 || run_renderer_in_process()) | 2218 if (pending_views_ || num_active_views > 0 || run_renderer_in_process()) |
| 2219 return; | 2219 return; |
| 2220 | 2220 |
| 2221 // Notify any contents that might have swapped out renderers from this | 2221 // Notify any contents that might have swapped out renderers from this |
| 2222 // process. They should not attempt to swap them back in. | 2222 // process. They should not attempt to swap them back in. |
| 2223 NotificationService::current()->Notify( | 2223 FOR_EACH_OBSERVER(RenderProcessHostObserver, observers_, |
| 2224 NOTIFICATION_RENDERER_PROCESS_CLOSING, | 2224 RenderProcessWillExit(this)); |
| 2225 Source<RenderProcessHost>(this), | |
| 2226 NotificationService::NoDetails()); | |
| 2227 | 2225 |
| 2228 mojo_application_host_->WillDestroySoon(); | 2226 mojo_application_host_->WillDestroySoon(); |
| 2229 | 2227 |
| 2230 Send(new ChildProcessMsg_Shutdown()); | 2228 Send(new ChildProcessMsg_Shutdown()); |
| 2231 } | 2229 } |
| 2232 | 2230 |
| 2233 void RenderProcessHostImpl::SuddenTerminationChanged(bool enabled) { | 2231 void RenderProcessHostImpl::SuddenTerminationChanged(bool enabled) { |
| 2234 SetSuddenTerminationAllowed(enabled); | 2232 SetSuddenTerminationAllowed(enabled); |
| 2235 } | 2233 } |
| 2236 | 2234 |
| (...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2510 void RenderProcessHostImpl::GetAudioOutputControllers( | 2508 void RenderProcessHostImpl::GetAudioOutputControllers( |
| 2511 const GetAudioOutputControllersCallback& callback) const { | 2509 const GetAudioOutputControllersCallback& callback) const { |
| 2512 audio_renderer_host()->GetOutputControllers(callback); | 2510 audio_renderer_host()->GetOutputControllers(callback); |
| 2513 } | 2511 } |
| 2514 | 2512 |
| 2515 BluetoothDispatcherHost* RenderProcessHostImpl::GetBluetoothDispatcherHost() { | 2513 BluetoothDispatcherHost* RenderProcessHostImpl::GetBluetoothDispatcherHost() { |
| 2516 return bluetooth_dispatcher_host_.get(); | 2514 return bluetooth_dispatcher_host_.get(); |
| 2517 } | 2515 } |
| 2518 | 2516 |
| 2519 } // namespace content | 2517 } // namespace content |
| OLD | NEW |