| 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 1674 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1685 void RenderProcessHostImpl::EndFrameSubscription(int route_id) { | 1685 void RenderProcessHostImpl::EndFrameSubscription(int route_id) { |
| 1686 if (!gpu_message_filter_) | 1686 if (!gpu_message_filter_) |
| 1687 return; | 1687 return; |
| 1688 BrowserThread::PostTask(BrowserThread::IO, FROM_HERE, base::Bind( | 1688 BrowserThread::PostTask(BrowserThread::IO, FROM_HERE, base::Bind( |
| 1689 &GpuMessageFilter::EndFrameSubscription, | 1689 &GpuMessageFilter::EndFrameSubscription, |
| 1690 gpu_message_filter_, | 1690 gpu_message_filter_, |
| 1691 route_id)); | 1691 route_id)); |
| 1692 } | 1692 } |
| 1693 | 1693 |
| 1694 void RenderProcessHostImpl::OnShutdownRequest() { | 1694 void RenderProcessHostImpl::OnShutdownRequest() { |
| 1695 // Don't shut down if there are more active RenderViews than the one asking | 1695 // Don't shut down if there are active RenderViews, or if there are pending |
| 1696 // to close, or if there are pending RenderViews being swapped back in. | 1696 // RenderViews being swapped back in. |
| 1697 // In single process mode, we never shutdown the renderer. | 1697 // In single process mode, we never shutdown the renderer. |
| 1698 int num_active_views = GetActiveViewCount(); | 1698 int num_active_views = GetActiveViewCount(); |
| 1699 if (pending_views_ || num_active_views > 1 || run_renderer_in_process()) | 1699 if (pending_views_ || num_active_views > 0 || run_renderer_in_process()) |
| 1700 return; | 1700 return; |
| 1701 | 1701 |
| 1702 // Notify any contents that might have swapped out renderers from this | 1702 // Notify any contents that might have swapped out renderers from this |
| 1703 // process. They should not attempt to swap them back in. | 1703 // process. They should not attempt to swap them back in. |
| 1704 NotificationService::current()->Notify( | 1704 NotificationService::current()->Notify( |
| 1705 NOTIFICATION_RENDERER_PROCESS_CLOSING, | 1705 NOTIFICATION_RENDERER_PROCESS_CLOSING, |
| 1706 Source<RenderProcessHost>(this), | 1706 Source<RenderProcessHost>(this), |
| 1707 NotificationService::NoDetails()); | 1707 NotificationService::NoDetails()); |
| 1708 | 1708 |
| 1709 Send(new ChildProcessMsg_Shutdown()); | 1709 Send(new ChildProcessMsg_Shutdown()); |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1804 continue; | 1804 continue; |
| 1805 | 1805 |
| 1806 RenderViewHost* rvh = | 1806 RenderViewHost* rvh = |
| 1807 RenderViewHost::From(const_cast<RenderWidgetHost*>(widget)); | 1807 RenderViewHost::From(const_cast<RenderWidgetHost*>(widget)); |
| 1808 | 1808 |
| 1809 rvh->UpdateWebkitPreferences(rvh->GetWebkitPreferences()); | 1809 rvh->UpdateWebkitPreferences(rvh->GetWebkitPreferences()); |
| 1810 } | 1810 } |
| 1811 } | 1811 } |
| 1812 | 1812 |
| 1813 } // namespace content | 1813 } // namespace content |
| OLD | NEW |