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

Unified Diff: content/browser/bad_message.cc

Issue 2387113004: Better bad message reporting from IO thread (Closed)
Patch Set: cleanup Created 4 years, 2 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: 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,

Powered by Google App Engine
This is Rietveld 408576698