[Crash Reporting] Implement a more direct bridge for extracting logcat output.
When a child process crashes, Chrome attempts to attach recent logcat
output to the minidump for the crash. Previously, this was implemented
via a FileObserver on the crash reports directory: When the file observer
detected a file moved into the directory, and saw that the filename
matched the appropriate regex pattern, it would attempt to append logcat
output. This has two drawbacks:
(1) It's spooky action at a distance, which makes the code harder to
reason about.
(2) There's a super subtle constraint encoded into the "moved to" check:
When the browser process crashes, a crash dump matching the same
file pattern appears in the observed directory, but it is *created*
rather than *moved*. Thus, this check is intentionally excluding
browser crashes, for which the code might otherwise have a race
between trying to attach logcat output and tearing down the main
Java process.
This CL replaces the FileObserver with a direct call from the C++ code
that processes the minidump into the Java code that extracts the logcat.
(Well, there's some indirection to get through the Chrome layering onion,
but the flow is still much more linear.)
BUG=719129
TEST=CrashDumpManagerTest.*
R=gsennton@chromium.org
Review-Url: https://codereview.chromium.org/2878193002
Cr-Commit-Position: refs/heads/master@{#472613}
13 files changed