| 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;
|
| }
|
|
|
|
|