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

Unified Diff: components/metrics/metrics_log.cc

Issue 2428413005: Revise system profile prefs clearing (Closed)
Patch Set: Created 4 years, 2 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
Index: components/metrics/metrics_log.cc
diff --git a/components/metrics/metrics_log.cc b/components/metrics/metrics_log.cc
index 3824762e217d71c3d5d49fd925ab43207a558366..5069e7bcd77d99e87df4f10b6eedb88db7e25591 100644
--- a/components/metrics/metrics_log.cc
+++ b/components/metrics/metrics_log.cc
@@ -420,6 +420,8 @@ void MetricsLog::RecordEnvironment(
std::string serialized_system_profile;
std::string base64_system_profile;
if (system_profile->SerializeToString(&serialized_system_profile)) {
+ // Persist the system profile to disk. In the event of an unclean shutdown,
+ // it will be used as part of the initial stability report.
base::Base64Encode(serialized_system_profile, &base64_system_profile);
PrefService* local_state = local_state_;
local_state->SetString(prefs::kStabilitySavedSystemProfile,
@@ -438,11 +440,8 @@ bool MetricsLog::LoadSavedEnvironmentFromPrefs(std::string* app_version) {
local_state->GetString(prefs::kStabilitySavedSystemProfile);
if (base64_system_profile.empty())
return false;
-
const std::string system_profile_hash =
local_state->GetString(prefs::kStabilitySavedSystemProfileHash);
- local_state->ClearPref(prefs::kStabilitySavedSystemProfile);
- local_state->ClearPref(prefs::kStabilitySavedSystemProfileHash);
SystemProfileProto* system_profile = uma_proto()->mutable_system_profile();
std::string serialized_system_profile;

Powered by Google App Engine
This is Rietveld 408576698