Chromium Code Reviews| Index: components/browser_watcher/postmortem_report_collector.cc |
| diff --git a/components/browser_watcher/postmortem_report_collector.cc b/components/browser_watcher/postmortem_report_collector.cc |
| index 24cb0b67c018d61b56fecc4ddeb07ba09e342ebf..e3030ba5d810f61e2c6612de9fb62340f699b5dc 100644 |
| --- a/components/browser_watcher/postmortem_report_collector.cc |
| +++ b/components/browser_watcher/postmortem_report_collector.cc |
| @@ -167,17 +167,24 @@ PostmortemReportCollector::CollectionStatus PostmortemReportCollector::Collect( |
| return ANALYZER_CREATION_FAILED; |
| // Early exit if there is no data. |
| + std::vector<std::string> log_messages = global_analyzer->GetLogMessages(); |
| ThreadActivityAnalyzer* thread_analyzer = global_analyzer->GetFirstAnalyzer(); |
| - if (!thread_analyzer) { |
| + if (log_messages.empty() && !thread_analyzer) { |
|
bcwhite
2016/12/09 00:34:22
It's possible to have log messages even on a clean
manzagop (departed)
2016/12/09 22:41:09
Right: if we stop deleting the file on clean exit,
bcwhite
2016/12/09 23:17:06
log_messages being empty or non-empty doesn't cons
manzagop (departed)
2016/12/12 15:59:32
I've removed the mention of clean exit: this shoul
bcwhite
2016/12/13 13:22:55
So to be clear... You _do_ want to send a report
manzagop (departed)
2016/12/13 14:01:39
That's right: short term we rely on MarkStabilityF
|
| // No data. This case happens in the case of a clean exit. |
| return DEBUG_FILE_NO_DATA; |
| } |
| - // Iterate through the thread analyzers, fleshing out the report. |
| + // Create the report, then flesh it out. |
| report->reset(new StabilityReport()); |
| + |
| + // Collect log messages. |
| + for (const std::string& message : log_messages) { |
| + (*report)->add_log_messages(message); |
| + } |
| + |
| + // Collect thread activity data. |
| // Note: a single process is instrumented. |
| ProcessState* process_state = (*report)->add_process_states(); |
| - |
| for (; thread_analyzer != nullptr; |
| thread_analyzer = global_analyzer->GetNextAnalyzer()) { |
| // Only valid analyzers are expected per contract of GetFirstAnalyzer / |