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

Unified Diff: components/nacl/browser/bad_message.cc

Issue 2514323004: Convert NaCl renderer-browser messages to mojo. (Closed)
Patch Set: rebase Created 3 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: components/nacl/browser/bad_message.cc
diff --git a/components/nacl/browser/bad_message.cc b/components/nacl/browser/bad_message.cc
index a6a9429cc2e0a8c3da40cf808b550a55cc8e4ef0..cc2cc684c2733142e05cfb3df58c14cbce071ed0 100644
--- a/components/nacl/browser/bad_message.cc
+++ b/components/nacl/browser/bad_message.cc
@@ -6,16 +6,30 @@
#include "base/logging.h"
#include "base/metrics/histogram_macros.h"
-#include "content/public/browser/browser_message_filter.h"
+#include "content/public/browser/browser_thread.h"
+#include "content/public/browser/render_process_host.h"
namespace nacl {
namespace bad_message {
+namespace {
-void ReceivedBadMessage(content::BrowserMessageFilter* filter,
- BadMessageReason reason) {
+void TerminateRendererOnUiThread(int render_process_id) {
+ content::RenderProcessHost* render_process_host =
+ content::RenderProcessHost::FromID(render_process_id);
+ if (render_process_host) {
+ render_process_host->ShutdownForBadMessage(
+ content::RenderProcessHost::CrashReportMode::GENERATE_CRASH_DUMP);
+ }
+}
+
+} // namespace
+
+void ReceivedBadMessage(int render_process_id, BadMessageReason reason) {
LOG(ERROR) << "Terminating renderer for bad IPC message, reason " << reason;
UMA_HISTOGRAM_SPARSE_SLOWLY("Stability.BadMessageTerminated.NaCl", reason);
- filter->ShutdownForBadMessage();
+ content::BrowserThread::PostTask(
+ content::BrowserThread::UI, FROM_HERE,
+ base::Bind(&TerminateRendererOnUiThread, render_process_id));
}
} // namespace bad_message

Powered by Google App Engine
This is Rietveld 408576698