Chromium Code Reviews| Index: content/browser/bad_message.cc |
| diff --git a/content/browser/bad_message.cc b/content/browser/bad_message.cc |
| index 183b46e70e95e9cde7b6867b37b9a29ababecbaa..4ef20f86cd8e7b6dd4ac02d6089ef9c503273a17 100644 |
| --- a/content/browser/bad_message.cc |
| +++ b/content/browser/bad_message.cc |
| @@ -6,6 +6,7 @@ |
| #include "base/bind.h" |
| #include "base/debug/crash_logging.h" |
| +#include "base/debug/dump_without_crashing.h" |
| #include "base/logging.h" |
| #include "base/metrics/sparse_histogram.h" |
| #include "base/strings/string_number_conversions.h" |
| @@ -29,18 +30,29 @@ void ReceivedBadMessageOnUIThread(int render_process_id, |
| BadMessageReason reason) { |
| DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| RenderProcessHost* host = RenderProcessHost::FromID(render_process_id); |
| - if (host) |
| - ReceivedBadMessage(host, reason); |
| + if (!host) |
| + return; |
| + |
| + LogBadMessage(reason); |
| + |
| + // A dump has already been generated by the caller. Don't generate another. |
| + host->ShutdownForBadMessage( |
| + RenderProcessHost::CrashReportMode::NO_CRASH_DUMP); |
| } |
| } // namespace |
| void ReceivedBadMessage(RenderProcessHost* host, BadMessageReason reason) { |
| LogBadMessage(reason); |
| - host->ShutdownForBadMessage(); |
| + host->ShutdownForBadMessage( |
| + RenderProcessHost::CrashReportMode::GENERATE_CRASH_DUMP); |
| } |
| void ReceivedBadMessage(int render_process_id, BadMessageReason reason) { |
| + // We generate a crash dump here since generating one after posting the UI |
| + // thread is mostly useless. |
| + base::debug::DumpWithoutCrashing(); |
|
Charlie Reis
2017/01/12 00:39:30
I just looked at a crash report that hit this (9fa
|
| + |
| if (!BrowserThread::CurrentlyOn(BrowserThread::UI)) { |
| BrowserThread::PostTask( |
| BrowserThread::UI, |