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

Unified Diff: chrome/browser/renderer_host/browser_render_process_host.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: address comments 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/renderer_host/browser_render_process_host.cc
diff --git a/chrome/browser/renderer_host/browser_render_process_host.cc b/chrome/browser/renderer_host/browser_render_process_host.cc
index 82caa115a24ff81b034a3690ee2169a625ba56d9..148a6f61930172148fdbed9c02a0d0c25db5375e 100644
--- a/chrome/browser/renderer_host/browser_render_process_host.cc
+++ b/chrome/browser/renderer_host/browser_render_process_host.cc
@@ -992,6 +992,8 @@ bool BrowserRenderProcessHost::OnMessageReceived(const IPC::Message& msg) {
OnUserMetricsRecordAction)
IPC_MESSAGE_HANDLER(ViewHostMsg_SpellChecker_RequestDictionary,
OnSpellCheckerRequestDictionary)
+ IPC_MESSAGE_HANDLER_DELAY_REPLY(ViewHostMsg_RenderProcessOutOfJSMemory,
+ OnRenderProcessOutOfJSMemory)
IPC_MESSAGE_UNHANDLED_ERROR()
IPC_END_MESSAGE_MAP_EX()
@@ -1233,6 +1235,19 @@ void BrowserRenderProcessHost::OnSpellCheckerRequestDictionary() {
}
}
+void BrowserRenderProcessHost::OnRenderProcessOutOfJSMemory(
+ IPC::Message* reply_msg) {
+ Send(reply_msg);
+
+ // Show OOM notification bar in all tabs sharing this render process.
+ IDMap<IPC::Channel::Listener>::iterator iter(&listeners_);
+ while (!iter.IsAtEnd()) {
+ iter.GetCurrentValue()->OnMessageReceived(
+ ViewHostMsg_JSOutOfMemory(iter.GetCurrentKey()));
+ iter.Advance();
+ }
+}
+
void BrowserRenderProcessHost::AddSpellCheckWord(const std::string& word) {
Send(new ViewMsg_SpellChecker_WordAdded(word));
}

Powered by Google App Engine
This is Rietveld 408576698