| 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
|
|
|