Index: chrome/browser/metrics/chrome_metrics_service_client.cc |
diff --git a/chrome/browser/metrics/chrome_metrics_service_client.cc b/chrome/browser/metrics/chrome_metrics_service_client.cc |
index 2861db7cdd25856894100c062c4ab3cc835428f0..3f0bd7d2efe89d38effad86da9d89041f1cbac33 100644 |
--- a/chrome/browser/metrics/chrome_metrics_service_client.cc |
+++ b/chrome/browser/metrics/chrome_metrics_service_client.cc |
@@ -213,6 +213,20 @@ ChromeMetricsServiceClient::ChromeMetricsServiceClient( |
ChromeMetricsServiceClient::~ChromeMetricsServiceClient() { |
DCHECK(thread_checker_.CalledOnValidThread()); |
+ |
+ // If there is a global metrics file being updated on disk, mark it to be |
Alexei Svitkine (slow)
2016/06/16 11:36:57
Please make a function in the anon namespace that
bcwhite
2016/06/16 14:21:08
Done.
I checked that the object is deleted on cle
|
+ // deleted when the process exits. A normal shutdown is almost complete |
+ // so there is no benefit in keeping a file with no new data to be processed |
+ // during the next startup sequence. |
+ base::GlobalHistogramAllocator* allocator = |
+ base::GlobalHistogramAllocator::Get(); |
+ if (allocator) { |
+ base::FilePath path = allocator->GetPersistentLocation(); |
+ if (!path.empty()) { |
+ base::File file(path, base::File::FLAG_OPEN | base::File::FLAG_READ | |
+ base::File::FLAG_DELETE_ON_CLOSE); |
+ } |
+ } |
} |
// static |