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

Unified Diff: content/browser/bad_message.cc

Issue 1145013004: Introduce bad_message.h for chrome and NaCl. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 5 years, 7 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
« no previous file with comments | « content/browser/bad_message.h ('k') | content/browser/cache_storage/cache_storage_dispatcher_host.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/bad_message.cc
diff --git a/content/browser/bad_message.cc b/content/browser/bad_message.cc
index cc41b00bd82fce643d63931134ee855ccb0a1e42..975aab1441ce15eb14130b0d0a9eb6ff23a56f71 100644
--- a/content/browser/bad_message.cc
+++ b/content/browser/bad_message.cc
@@ -6,17 +6,31 @@
#include "base/logging.h"
#include "base/metrics/histogram_macros.h"
+#include "content/public/browser/browser_message_filter.h"
#include "content/public/browser/render_process_host.h"
namespace content {
namespace bad_message {
-void ReceivedBadMessage(RenderProcessHost* host, BadMessageReason reason) {
+namespace {
+
+void LogBadMessage(BadMessageReason reason) {
LOG(ERROR) << "Terminating renderer for bad IPC message, reason " << reason;
UMA_HISTOGRAM_ENUMERATION("Stability.BadMessageTerminated.Content", reason,
BAD_MESSAGE_MAX);
+}
+
+} // namespace
+
+void ReceivedBadMessage(RenderProcessHost* host, BadMessageReason reason) {
+ LogBadMessage(reason);
host->ShutdownForBadMessage();
}
+void ReceivedBadMessage(BrowserMessageFilter* filter, BadMessageReason reason) {
+ LogBadMessage(reason);
+ filter->ShutdownForBadMessage();
+}
+
} // namespace bad_message
} // namespace content
« no previous file with comments | « content/browser/bad_message.h ('k') | content/browser/cache_storage/cache_storage_dispatcher_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698