Index: content/browser/frame_host/render_frame_host_impl.cc |
diff --git a/content/browser/frame_host/render_frame_host_impl.cc b/content/browser/frame_host/render_frame_host_impl.cc |
index 5878180ae16a4662195f58f2e417b14557f21ec0..b627a99058e63da745303537ea6d24332cbccb36 100644 |
--- a/content/browser/frame_host/render_frame_host_impl.cc |
+++ b/content/browser/frame_host/render_frame_host_impl.cc |
@@ -10,6 +10,7 @@ |
#include "base/lazy_instance.h" |
#include "base/metrics/histogram.h" |
#include "base/metrics/user_metrics_action.h" |
+#include "base/process/kill.h" |
#include "base/time/time.h" |
#include "content/browser/accessibility/accessibility_mode_helper.h" |
#include "content/browser/accessibility/browser_accessibility_manager.h" |
@@ -365,6 +366,9 @@ bool RenderFrameHostImpl::OnMessageReceived(const IPC::Message &msg) { |
IPC_MESSAGE_HANDLER(AccessibilityHostMsg_FindInPageResult, |
OnAccessibilityFindInPageResult) |
IPC_MESSAGE_HANDLER(FrameHostMsg_ToggleFullscreen, OnToggleFullscreen) |
+ // The following message is synthetic and doesn't come from RenderFrame, but |
+ // from RenderProcessHost. |
+ IPC_MESSAGE_HANDLER(FrameHostMsg_RenderProcessGone, OnRenderProcessGone) |
#if defined(OS_MACOSX) || defined(OS_ANDROID) |
IPC_MESSAGE_HANDLER(FrameHostMsg_ShowPopup, OnShowPopup) |
IPC_MESSAGE_HANDLER(FrameHostMsg_HidePopup, OnHidePopup) |
@@ -995,6 +999,30 @@ void RenderFrameHostImpl::OnSwapOutACK() { |
OnSwappedOut(); |
} |
+void RenderFrameHostImpl::OnRenderProcessGone(int status, int exit_code) { |
+ if (frame_tree_node_->IsMainFrame()) { |
+ // Keep the termination status so we can get at it later when we |
+ // need to know why it died. |
+ render_view_host_->render_view_termination_status_ = |
+ static_cast<base::TerminationStatus>(status); |
+ } |
+ |
+ // Reset frame tree state associated with this process. This must happen |
+ // before RenderViewTerminated because observers expect the subframes of any |
+ // affected frames to be cleared first. |
+ frame_tree_node_->frame_tree()->RenderProcessGone(render_view_host_); |
Charlie Reis
2015/02/05 00:53:13
Looking closer, FrameTree::RenderProcessGone walks
nasko
2015/02/05 23:08:45
Good point! Inlined those two calls.
|
+ |
+ if (frame_tree_node_->IsMainFrame()) { |
+ // RenderViewHost/RenderWidgetHost needs to reset some stuff. |
+ render_view_host_->RendererExited( |
+ render_view_host_->render_view_termination_status_, exit_code); |
+ |
+ render_view_host_->delegate_->RenderViewTerminated( |
+ render_view_host_, static_cast<base::TerminationStatus>(status), |
+ exit_code); |
+ } |
+} |
+ |
void RenderFrameHostImpl::OnSwappedOut() { |
// Ignore spurious swap out ack. |
if (rfh_state_ != STATE_PENDING_SWAP_OUT) |