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

Unified Diff: chrome/browser/tab_contents/tab_contents.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: Upload after sync for proper diffs 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/tab_contents/tab_contents.cc
diff --git a/chrome/browser/tab_contents/tab_contents.cc b/chrome/browser/tab_contents/tab_contents.cc
index 371e221d4eb3e32d519af552a82c58c07b2daf5d..929fbf09979641d4569cc0caa7f6091131ce0865 100644
--- a/chrome/browser/tab_contents/tab_contents.cc
+++ b/chrome/browser/tab_contents/tab_contents.cc
@@ -334,7 +334,8 @@ TabContents::TabContents(Profile* profile,
bookmark_drag_(NULL),
ALLOW_THIS_IN_INITIALIZER_LIST(fav_icon_helper_(this)),
is_loading_(false),
- is_crashed_(false),
+ crashed_status_(base::TERMINATION_STATUS_STILL_RUNNING),
+ crashed_error_code_(0),
waiting_for_response_(false),
max_page_id_(-1),
current_load_start_(),
@@ -765,11 +766,12 @@ void TabContents::RemoveNavigationObserver(WebNavigationObserver* observer) {
web_navigation_observers_.RemoveObserver(observer);
}
-void TabContents::SetIsCrashed(bool state) {
- if (state == is_crashed_)
+void TabContents::SetIsCrashed(base::TerminationStatus status, int error_code) {
+ if (status == crashed_status_)
return;
- is_crashed_ = state;
+ crashed_status_ = status;
+ crashed_error_code_ = error_code;
NotifyNavigationStateChanged(INVALIDATE_TAB);
}
@@ -2395,7 +2397,7 @@ void TabContents::RenderViewReady(RenderViewHost* rvh) {
NotifyConnected();
bool was_crashed = is_crashed();
- SetIsCrashed(false);
+ SetIsCrashed(base::TERMINATION_STATUS_STILL_RUNNING, 0);
// Restore the focus to the tab (otherwise the focus will be on the top
// window).
@@ -2405,7 +2407,9 @@ void TabContents::RenderViewReady(RenderViewHost* rvh) {
}
}
-void TabContents::RenderViewGone(RenderViewHost* rvh) {
+void TabContents::RenderViewGone(RenderViewHost* rvh,
+ base::TerminationStatus status,
+ int error_code) {
// Ask the print preview if this renderer was valuable.
if (!printing_->OnRenderViewGone(rvh))
return;
@@ -2416,7 +2420,7 @@ void TabContents::RenderViewGone(RenderViewHost* rvh) {
SetIsLoading(false, NULL);
NotifyDisconnected();
- SetIsCrashed(true);
+ SetIsCrashed(status, error_code);
// Remove all infobars.
for (int i = infobar_delegate_count() - 1; i >=0 ; --i)
@@ -3035,7 +3039,8 @@ void TabContents::DidStartLoadingFromRenderManager(
void TabContents::RenderViewGoneFromRenderManager(
RenderViewHost* render_view_host) {
- RenderViewGone(render_view_host);
+ DCHECK(crashed_status_ != base::TERMINATION_STATUS_STILL_RUNNING);
+ RenderViewGone(render_view_host, crashed_status_, crashed_error_code_);
}
void TabContents::UpdateRenderViewSizeForRenderManager() {

Powered by Google App Engine
This is Rietveld 408576698