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

Unified Diff: components/metrics/persisted_logs.cc

Issue 2567263003: Basic UkmService implementation (Closed)
Patch Set: Rebase Created 3 years, 11 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/persisted_logs.cc
diff --git a/components/metrics/persisted_logs.cc b/components/metrics/persisted_logs.cc
index b7aa8f003e3428e04052850fedc8b251287e8bfb..3e1913ded9492eced6cad1609372947823318eee 100644
--- a/components/metrics/persisted_logs.cc
+++ b/components/metrics/persisted_logs.cc
@@ -109,6 +109,14 @@ void PersistedLogs::DiscardStagedLog() {
staged_log_index_ = -1;
}
+void PersistedLogs::Purge() {
+ if (has_staged_log()) {
+ DiscardStagedLog();
+ }
+ list_.clear();
+ local_state_->ClearPref(pref_name_);
+}
+
PersistedLogs::LogReadStatus PersistedLogs::ReadLogsFromPrefList(
const base::ListValue& list_value) {
if (list_value.empty())

Powered by Google App Engine
This is Rietveld 408576698