| Index: content/browser/renderer_host/browser_render_process_host.cc
|
| diff --git a/content/browser/renderer_host/browser_render_process_host.cc b/content/browser/renderer_host/browser_render_process_host.cc
|
| index 7222b096aa1ee70a107f712d16a55ce7e821ea76..b1284869967a3de5d1408ad222b513743321c2e7 100644
|
| --- a/content/browser/renderer_host/browser_render_process_host.cc
|
| +++ b/content/browser/renderer_host/browser_render_process_host.cc
|
| @@ -411,9 +411,9 @@ void BrowserRenderProcessHost::CancelResourceRequests(int render_widget_id) {
|
| widget_helper_->CancelResourceRequests(render_widget_id);
|
| }
|
|
|
| -void BrowserRenderProcessHost::CrossSiteClosePageACK(
|
| - const ViewMsg_ClosePage_Params& params) {
|
| - widget_helper_->CrossSiteClosePageACK(params);
|
| +void BrowserRenderProcessHost::CrossSiteSwapOutACK(
|
| + const ViewMsg_SwapOut_Params& params) {
|
| + widget_helper_->CrossSiteSwapOutACK(params);
|
| }
|
|
|
| bool BrowserRenderProcessHost::WaitForUpdateMsg(
|
| @@ -784,6 +784,8 @@ bool BrowserRenderProcessHost::OnMessageReceived(const IPC::Message& msg) {
|
| // Dispatch control messages.
|
| bool msg_is_ok = true;
|
| IPC_BEGIN_MESSAGE_MAP_EX(BrowserRenderProcessHost, msg, msg_is_ok)
|
| + IPC_MESSAGE_HANDLER(ChildProcessHostMsg_ShutdownRequest,
|
| + OnShutdownRequest)
|
| IPC_MESSAGE_HANDLER(ViewHostMsg_UpdatedCacheStats,
|
| OnUpdatedCacheStats)
|
| IPC_MESSAGE_HANDLER(ViewHostMsg_SuddenTerminationChanged,
|
| @@ -823,6 +825,10 @@ void BrowserRenderProcessHost::OnChannelConnected(int32 peer_pid) {
|
| Send(new ChildProcessMsg_SetIPCLoggingEnabled(
|
| IPC::Logging::GetInstance()->Enabled()));
|
| #endif
|
| +
|
| + // Make sure the child checks with us before exiting, so that we do not try
|
| + // to schedule a new navigation in a swapped out and exiting renderer.
|
| + Send(new ChildProcessMsg_AskBeforeShutdown());
|
| }
|
|
|
| void BrowserRenderProcessHost::OnChannelError() {
|
| @@ -878,6 +884,20 @@ void BrowserRenderProcessHost::OnChannelError() {
|
| // TODO(darin): clean this up
|
| }
|
|
|
| +void BrowserRenderProcessHost::OnShutdownRequest() {
|
| + // Don't shutdown if there are pending RenderViews being swapped back in.
|
| + if (pending_views_)
|
| + return;
|
| +
|
| + // Notify any tabs that might have swapped out renderers from this process
|
| + // on the swapped out list. They should not attempt to swap them back in.
|
| + NotificationService::current()->Notify(
|
| + NotificationType::RENDERER_PROCESS_CLOSING,
|
| + Source<RenderProcessHost>(this), NotificationService::NoDetails());
|
| +
|
| + Send(new ChildProcessMsg_Shutdown());
|
| +}
|
| +
|
| void BrowserRenderProcessHost::OnUpdatedCacheStats(
|
| const WebCache::UsageStats& stats) {
|
| WebCacheManager::GetInstance()->ObserveStats(id(), stats);
|
|
|