Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(203)

Side by Side Diff: chrome/browser/renderer_host/render_view_host.cc

Issue 5172009: This adds some plumbing for propagating the reason for a renderer's death (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Final review changes Created 10 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 #include "chrome/browser/renderer_host/render_view_host.h" 5 #include "chrome/browser/renderer_host/render_view_host.h"
6 6
7 #include <string> 7 #include <string>
8 #include <utility> 8 #include <utility>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
132 suspended_nav_message_(NULL), 132 suspended_nav_message_(NULL),
133 run_modal_reply_msg_(NULL), 133 run_modal_reply_msg_(NULL),
134 is_waiting_for_beforeunload_ack_(false), 134 is_waiting_for_beforeunload_ack_(false),
135 is_waiting_for_unload_ack_(false), 135 is_waiting_for_unload_ack_(false),
136 unload_ack_is_for_cross_site_transition_(false), 136 unload_ack_is_for_cross_site_transition_(false),
137 are_javascript_messages_suppressed_(false), 137 are_javascript_messages_suppressed_(false),
138 sudden_termination_allowed_(false), 138 sudden_termination_allowed_(false),
139 session_storage_namespace_(session_storage), 139 session_storage_namespace_(session_storage),
140 is_extension_process_(false), 140 is_extension_process_(false),
141 autofill_query_id_(0), 141 autofill_query_id_(0),
142 save_accessibility_tree_for_testing_(false) { 142 save_accessibility_tree_for_testing_(false),
143 render_view_termination_status_(base::TERMINATION_STATUS_STILL_RUNNING) {
143 if (!session_storage_namespace_) { 144 if (!session_storage_namespace_) {
144 session_storage_namespace_ = 145 session_storage_namespace_ =
145 new SessionStorageNamespace(process()->profile()); 146 new SessionStorageNamespace(process()->profile());
146 } 147 }
147 148
148 DCHECK(instance_); 149 DCHECK(instance_);
149 DCHECK(delegate_); 150 DCHECK(delegate_);
150 } 151 }
151 152
152 RenderViewHost::~RenderViewHost() { 153 RenderViewHost::~RenderViewHost() {
(...skipping 833 matching lines...) Expand 10 before | Expand all | Expand 10 after
986 987
987 void RenderViewHost::OnMsgRunModal(IPC::Message* reply_msg) { 988 void RenderViewHost::OnMsgRunModal(IPC::Message* reply_msg) {
988 DCHECK(!run_modal_reply_msg_); 989 DCHECK(!run_modal_reply_msg_);
989 run_modal_reply_msg_ = reply_msg; 990 run_modal_reply_msg_ = reply_msg;
990 991
991 // TODO(darin): Bug 1107929: Need to inform our delegate to show this view in 992 // TODO(darin): Bug 1107929: Need to inform our delegate to show this view in
992 // an app-modal fashion. 993 // an app-modal fashion.
993 } 994 }
994 995
995 void RenderViewHost::OnMsgRenderViewReady() { 996 void RenderViewHost::OnMsgRenderViewReady() {
997 render_view_termination_status_ = base::TERMINATION_STATUS_STILL_RUNNING;
996 WasResized(); 998 WasResized();
997 delegate_->RenderViewReady(this); 999 delegate_->RenderViewReady(this);
998 } 1000 }
999 1001
1000 void RenderViewHost::OnMsgRenderViewGone() { 1002 void RenderViewHost::OnMsgRenderViewGone(int status, int exit_code) {
1003 // Keep the termination status so we can get at it later when we
1004 // need to know why it died.
1005 render_view_termination_status_ =
1006 static_cast<base::TerminationStatus>(status);
1007
1001 // Our base class RenderWidgetHost needs to reset some stuff. 1008 // Our base class RenderWidgetHost needs to reset some stuff.
1002 RendererExited(); 1009 RendererExited(render_view_termination_status_, exit_code);
1003 1010
1004 delegate_->RenderViewGone(this); 1011 delegate_->RenderViewGone(this,
1012 static_cast<base::TerminationStatus>(status),
1013 exit_code);
1005 } 1014 }
1006 1015
1007 // Called when the renderer navigates. For every frame loaded, we'll get this 1016 // Called when the renderer navigates. For every frame loaded, we'll get this
1008 // notification containing parameters identifying the navigation. 1017 // notification containing parameters identifying the navigation.
1009 // 1018 //
1010 // Subframes are identified by the page transition type. For subframes loaded 1019 // Subframes are identified by the page transition type. For subframes loaded
1011 // as part of a wider page load, the page_id will be the same as for the top 1020 // as part of a wider page load, the page_id will be the same as for the top
1012 // level frame. If the user explicitly requests a subframe navigation, we will 1021 // level frame. If the user explicitly requests a subframe navigation, we will
1013 // get a new page_id because we need to create a new navigation entry for that 1022 // get a new page_id because we need to create a new navigation entry for that
1014 // action. 1023 // action.
(...skipping 1223 matching lines...) Expand 10 before | Expand all | Expand 10 after
2238 if (printer_query.get()) { 2247 if (printer_query.get()) {
2239 BrowserThread::PostTask( 2248 BrowserThread::PostTask(
2240 BrowserThread::IO, FROM_HERE, 2249 BrowserThread::IO, FROM_HERE,
2241 NewRunnableMethod(printer_query.get(), 2250 NewRunnableMethod(printer_query.get(),
2242 &printing::PrinterQuery::StopWorker)); 2251 &printing::PrinterQuery::StopWorker));
2243 } 2252 }
2244 2253
2245 // Send the printingDone msg for now. 2254 // Send the printingDone msg for now.
2246 Send(new ViewMsg_PrintingDone(routing_id(), -1, true)); 2255 Send(new ViewMsg_PrintingDone(routing_id(), -1, true));
2247 } 2256 }
OLDNEW
« no previous file with comments | « chrome/browser/renderer_host/render_view_host.h ('k') | chrome/browser/renderer_host/render_view_host_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698