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 // 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 1669 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1680 &GpuMessageFilter::EndFrameSubscription, | 1680 &GpuMessageFilter::EndFrameSubscription, |
1681 gpu_message_filter_, | 1681 gpu_message_filter_, |
1682 route_id)); | 1682 route_id)); |
1683 } | 1683 } |
1684 | 1684 |
1685 void RenderProcessHostImpl::OnShutdownRequest() { | 1685 void RenderProcessHostImpl::OnShutdownRequest() { |
1686 // Don't shut down if there are more active RenderViews than the one asking | 1686 // Don't shut down if there are more active RenderViews than the one asking |
1687 // to close, or if there are pending RenderViews being swapped back in. | 1687 // to close, or if there are pending RenderViews being swapped back in. |
1688 // In single process mode, we never shutdown the renderer. | 1688 // In single process mode, we never shutdown the renderer. |
1689 int num_active_views = GetActiveViewCount(); | 1689 int num_active_views = GetActiveViewCount(); |
1690 if (pending_views_ || num_active_views > 1 || run_renderer_in_process()) | 1690 if (pending_views_ || num_active_views > 0 || run_renderer_in_process()) |
1691 return; | 1691 return; |
1692 | 1692 |
1693 // Notify any contents that might have swapped out renderers from this | 1693 // Notify any contents that might have swapped out renderers from this |
1694 // process. They should not attempt to swap them back in. | 1694 // process. They should not attempt to swap them back in. |
1695 NotificationService::current()->Notify( | 1695 NotificationService::current()->Notify( |
1696 NOTIFICATION_RENDERER_PROCESS_CLOSING, | 1696 NOTIFICATION_RENDERER_PROCESS_CLOSING, |
1697 Source<RenderProcessHost>(this), | 1697 Source<RenderProcessHost>(this), |
1698 NotificationService::NoDetails()); | 1698 NotificationService::NoDetails()); |
1699 | 1699 |
1700 Send(new ChildProcessMsg_Shutdown()); | 1700 Send(new ChildProcessMsg_Shutdown()); |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1795 continue; | 1795 continue; |
1796 | 1796 |
1797 RenderViewHost* rvh = | 1797 RenderViewHost* rvh = |
1798 RenderViewHost::From(const_cast<RenderWidgetHost*>(widget)); | 1798 RenderViewHost::From(const_cast<RenderWidgetHost*>(widget)); |
1799 | 1799 |
1800 rvh->UpdateWebkitPreferences(rvh->GetWebkitPreferences()); | 1800 rvh->UpdateWebkitPreferences(rvh->GetWebkitPreferences()); |
1801 } | 1801 } |
1802 } | 1802 } |
1803 | 1803 |
1804 } // namespace content | 1804 } // namespace content |
OLD | NEW |