| 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 0de178493669b3255d5984fa4fac9190a44cbba4..537e2b11c5b611e1678264dad955b7b7de073514 100644
|
| --- a/chrome/browser/tab_contents/tab_contents.cc
|
| +++ b/chrome/browser/tab_contents/tab_contents.cc
|
| @@ -392,7 +392,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);
|
|
|
| @@ -2539,6 +2540,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
|
| @@ -3065,6 +3070,7 @@ void TabContents::OnIgnoredUIEvent() {
|
| }
|
|
|
| void TabContents::OnJSOutOfMemory() {
|
| + render_process_ran_out_of_memory_ = true;
|
| AddInfoBar(new SimpleAlertInfoBarDelegate(
|
| this, l10n_util::GetStringUTF16(IDS_JS_OUT_OF_MEMORY_PROMPT),
|
| NULL, true));
|
| @@ -3256,6 +3262,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;
|
| }
|
|
|
|
|