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

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: Renaming PROCESS_END_* to EXIT_CODE_* 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 6ec6ba34332303468e641388883569d82d954306..1fb6c6751a5edd2224e36e44f4b4604dc3f3104d 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_(),
@@ -774,11 +775,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);
}
@@ -2403,7 +2405,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).
@@ -2413,7 +2415,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;
@@ -2424,7 +2428,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)
@@ -3043,7 +3047,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