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

Unified Diff: chrome/browser/tab_contents/tab_contents.cc

Issue 6006006: Show OOM notification bar in all tabs sharing same render process (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Send reply to the sync message on the IO thread Created 9 years, 11 months 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 8a941cda905f9f4d8c781162b56443e9841ec49e..99464d7de10013660c99f96621a4760f10c8674b 100644
--- a/chrome/browser/tab_contents/tab_contents.cc
+++ b/chrome/browser/tab_contents/tab_contents.cc
@@ -323,7 +323,8 @@ TabContents::TabContents(Profile* profile,
maximum_zoom_percent_(
static_cast<int>(WebKit::WebView::maxTextSizeMultiplier * 100)),
temporary_zoom_settings_(false),
- content_restrictions_(0) {
+ content_restrictions_(0),
+ render_process_ran_out_of_memory_(false) {
renderer_preferences_util::UpdateFromSystemSettings(
&renderer_preferences_, profile);
@@ -2429,6 +2430,10 @@ void TabContents::RenderViewGone(RenderViewHost* rvh,
for (int i = infobar_delegate_count() - 1; i >=0 ; --i)
RemoveInfoBar(GetInfoBarDelegateAt(i));
+ // Restore OOM infobar.
+ if (render_process_ran_out_of_memory_)
+ OnJSOutOfMemory();
+
// Tell the view that we've crashed so it can prepare the sad tab page.
// Only do this if we're not in browser shutdown, so that TabContents
// objects that are not in a browser (e.g., HTML dialogs) and thus are
@@ -2937,6 +2942,7 @@ void TabContents::OnIgnoredUIEvent() {
}
void TabContents::OnJSOutOfMemory() {
+ render_process_ran_out_of_memory_ = true;
AddInfoBar(new SimpleAlertInfoBarDelegate(this, NULL,
l10n_util::GetStringUTF16(IDS_JS_OUT_OF_MEMORY_PROMPT), true));
}
@@ -3127,6 +3133,8 @@ void TabContents::Observe(NotificationType type,
NavigationController::LoadCommittedDetails& committed_details =
*(Details<NavigationController::LoadCommittedDetails>(details).ptr());
ExpireInfoBars(committed_details);
+
+ render_process_ran_out_of_memory_ = false;
break;
}

Powered by Google App Engine
This is Rietveld 408576698