| 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 58871bb9ac8b0ed6b0ea512fe0b131dde8309374..2a88264ff426dc5f209bb88abc46388365eaeef2 100644
|
| --- a/chrome/browser/tab_contents/tab_contents.cc
|
| +++ b/chrome/browser/tab_contents/tab_contents.cc
|
| @@ -372,7 +372,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),
|
| + renderer_ran_out_of_memory_(false) {
|
| renderer_preferences_util::UpdateFromSystemSettings(
|
| &renderer_preferences_, profile);
|
|
|
| @@ -2485,6 +2486,10 @@ void TabContents::RenderViewGone(RenderViewHost* rvh,
|
| for (int i = infobar_delegate_count() - 1; i >=0 ; --i)
|
| RemoveInfoBar(GetInfoBarDelegateAt(i));
|
|
|
| + // Restore OOM infobar.
|
| + if (renderer_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
|
| @@ -3024,6 +3029,7 @@ void TabContents::OnIgnoredUIEvent() {
|
| }
|
|
|
| void TabContents::OnJSOutOfMemory() {
|
| + renderer_ran_out_of_memory_ = true;
|
| AddInfoBar(new SimpleAlertInfoBarDelegate(
|
| this, l10n_util::GetStringUTF16(IDS_JS_OUT_OF_MEMORY_PROMPT),
|
| NULL, true));
|
| @@ -3215,6 +3221,8 @@ void TabContents::Observe(NotificationType type,
|
| NavigationController::LoadCommittedDetails& committed_details =
|
| *(Details<NavigationController::LoadCommittedDetails>(details).ptr());
|
| ExpireInfoBars(committed_details);
|
| +
|
| + renderer_ran_out_of_memory_ = false;
|
| break;
|
| }
|
|
|
|
|