Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(288)

Unified Diff: components/metrics/metrics_service.cc

Issue 2918533003: Send metrics with embedded system profiles after system startup. (Closed)
Patch Set: load profile from only the first found source Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « components/metrics/metrics_provider.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/metrics/metrics_service.cc
diff --git a/components/metrics/metrics_service.cc b/components/metrics/metrics_service.cc
index 529af17d829491521866ac870048baf24d07d1a7..b6d615f3e86191a6b6b31b71a6e9f3a626ed953a 100644
--- a/components/metrics/metrics_service.cc
+++ b/components/metrics/metrics_service.cc
@@ -783,9 +783,17 @@ bool MetricsService::PrepareInitialStabilityLog(
// Do not call NotifyOnDidCreateMetricsLog here because the stability
// log describes stats from the _previous_ session.
std::string system_profile_app_version;
- if (!initial_stability_log->LoadSavedEnvironmentFromPrefs(
- &system_profile_app_version)) {
- return false;
+ for (auto& provider : metrics_providers_) {
+ if (initial_stability_log->LoadSavedEnvironmentFromProvider(
+ provider.get(), &system_profile_app_version)) {
Alexei Svitkine (slow) 2017/05/31 20:31:24 Instead of replacing the profile of the stability
bcwhite 2017/05/31 20:48:29 Currently there is only ever one persistent histog
Alexei Svitkine (slow) 2017/06/01 15:00:29 Per offline discussion, I prefer to not have this
+ break;
+ }
+ }
+ if (system_profile_app_version.empty()) {
+ if (!initial_stability_log->LoadSavedEnvironmentFromPrefs(
+ &system_profile_app_version)) {
+ return false;
+ }
}
if (system_profile_app_version != prefs_previous_version)
StabilityMetricsProvider(local_state_).LogStabilityVersionMismatch();
« no previous file with comments | « components/metrics/metrics_provider.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698