Chromium Code Reviews| Index: components/metrics/metrics_service.cc |
| diff --git a/components/metrics/metrics_service.cc b/components/metrics/metrics_service.cc |
| index cad15984141323b821d374be362e103287d88dc8..5a3269fc3c823b07e587e50ec20a14a776cad053 100644 |
| --- a/components/metrics/metrics_service.cc |
| +++ b/components/metrics/metrics_service.cc |
| @@ -474,6 +474,11 @@ void MetricsService::OnAppEnterBackground() { |
| // persisting all logs. Unlinke a shutdown, the state is primed to be ready |
| // to continue logging and uploading if the process does return. |
| if (recording_active() && state_ >= SENDING_LOGS) { |
| + // Give providers a chance to persist histograms as part of being |
| + // backgrounded. |
| + for (MetricsProvider* provider : metrics_providers_) |
|
Bryan McQuade
2016/07/27 13:18:34
I wasnt't sure if we should be informing providers
Alexei Svitkine (slow)
2016/07/27 17:41:11
It's debatable, but I somewhat prefer doing it out
Bryan McQuade
2016/07/27 18:25:15
Good point, I agree. I moved it.
|
| + provider->OnAppEnterBackground(); |
| + |
| PushPendingLogsToPersistentStorage(); |
| // Persisting logs closes the current log, so start recording a new log |
| // immediately to capture any background work that might be done before the |