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

Unified Diff: components/metrics/persisted_logs.cc

Issue 2567263003: Basic UkmService implementation (Closed)
Patch Set: Proto and client_id Created 4 years 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/persisted_logs.cc
diff --git a/components/metrics/persisted_logs.cc b/components/metrics/persisted_logs.cc
index a407a0d46970e04f192011fd047bf7545d84c668..922a296f94742494bb0837e7e291933857530eed 100644
--- a/components/metrics/persisted_logs.cc
+++ b/components/metrics/persisted_logs.cc
@@ -96,14 +96,14 @@ void PersistedLogs::SerializeLogs() const {
// After writing all the logs to the new pref remove old outdated pref.
// TODO(gayane): Remove when all users are migrated. crbug.com/649440
- if (local_state_->HasPrefPath(outdated_pref_name_))
+ if (outdated_pref_name_ && local_state_->HasPrefPath(outdated_pref_name_))
rkaplow 2017/01/02 23:23:03 how is this related?
Steven Holte 2017/01/03 21:16:03 This is allowing Persisted logs to be created with
local_state_->ClearPref(outdated_pref_name_);
}
PersistedLogs::LogReadStatus PersistedLogs::DeserializeLogs() {
// TODO(gayane): Remove the code for reading logs from outdated pref when all
// users are migrated. crbug.com/649440
- if (local_state_->HasPrefPath(outdated_pref_name_)) {
+ if (outdated_pref_name_ && local_state_->HasPrefPath(outdated_pref_name_)) {
return ReadLogsFromOldFormatPrefList(
*local_state_->GetList(outdated_pref_name_));
}

Powered by Google App Engine
This is Rietveld 408576698