Index: components/browser_watcher/stability_report_user_stream_data_source.cc |
diff --git a/components/browser_watcher/stability_report_user_stream_data_source.cc b/components/browser_watcher/stability_report_user_stream_data_source.cc |
index 62fdf2235edd63531b4c6d53b8985b846af9632d..b545e2c82c3ede21b63d7b0e8ae581da155d778c 100644 |
--- a/components/browser_watcher/stability_report_user_stream_data_source.cc |
+++ b/components/browser_watcher/stability_report_user_stream_data_source.cc |
@@ -73,6 +73,8 @@ bool BufferExtensionStreamDataSource::ReadStreamData(Delegate* delegate) { |
data_.size() ? data_.data() : nullptr, data_.size()); |
} |
+// TODO(manzagop): collection should factor in whether this is a true crash or |
+// dump without crashing. |
std::unique_ptr<BufferExtensionStreamDataSource> CollectReport( |
const base::FilePath& path) { |
StabilityReport report; |
@@ -82,15 +84,9 @@ std::unique_ptr<BufferExtensionStreamDataSource> CollectReport( |
if (status != SUCCESS) |
return nullptr; |
- // Open (with delete) and then immediately close the file by going out of |
- // scope. This should cause the stability debugging file to be deleted prior |
- // to the next execution. |
- // TODO(manzagop): set the persistent allocator file's state to deleted in |
- // case the file can't be deleted. |
- base::File file(path, base::File::FLAG_OPEN | base::File::FLAG_READ | |
- base::File::FLAG_DELETE_ON_CLOSE); |
- UMA_HISTOGRAM_BOOLEAN("ActivityTracker.CollectCrash.OpenForDeleteSuccess", |
- file.IsValid()); |
+ MarkStabilityFileDeleted(path); |
+ UMA_STABILITY_HISTOGRAM_COUNTS_100("ActivityTracker.CollectCrash.CrashCount", |
+ 1); |
std::unique_ptr<BufferExtensionStreamDataSource> source( |
new BufferExtensionStreamDataSource(kStabilityReportStreamType)); |