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

Unified Diff: components/ukm/ukm_service.h

Issue 2737953002: UKM: Remove UkmService::RecordSource (Closed)
Patch Set: fix error from rebase Created 3 years, 9 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/ukm/test_ukm_service.cc ('k') | components/ukm/ukm_service.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/ukm/ukm_service.h
diff --git a/components/ukm/ukm_service.h b/components/ukm/ukm_service.h
index d5d19c495d830c1c025054e281bcd3db806c9afc..613658fbf5ac27e68888cb44304d00e99e523575 100644
--- a/components/ukm/ukm_service.h
+++ b/components/ukm/ukm_service.h
@@ -99,7 +99,8 @@ class UkmService : public base::SupportsWeakPtr<UkmService> {
using AddEntryCallback = base::Callback<void(std::unique_ptr<UkmEntry>)>;
protected:
- const std::vector<std::unique_ptr<UkmSource>>& sources_for_testing() const {
+ const std::map<int32_t, std::unique_ptr<UkmSource>>& sources_for_testing()
+ const {
return sources_;
}
@@ -126,11 +127,6 @@ class UkmService : public base::SupportsWeakPtr<UkmService> {
std::unique_ptr<UkmEntryBuilder> GetEntryBuilder(int32_t source_id,
const char* event_name);
- // Adds a new source of UKM metrics, which will be stored until periodically
- // serialized for upload, and then deleted. This method is deprecated. Please
- // use GetEntryBuilder and UpdateSourceURL above.
- void RecordSource(std::unique_ptr<UkmSource> source);
-
// Starts metrics client initialization.
void StartInitTask();
@@ -190,8 +186,7 @@ class UkmService : public base::SupportsWeakPtr<UkmService> {
// Contains newly added sources and entries of UKM metrics which periodically
// get serialized and cleared by BuildAndStoreLog().
- // TODO(zhenw): update sources to a map keyed by source ID.
- std::vector<std::unique_ptr<UkmSource>> sources_;
+ std::map<int32_t, std::unique_ptr<UkmSource>> sources_;
std::vector<std::unique_ptr<UkmEntry>> entries_;
// Weak pointers factory used to post task on different threads. All weak
« no previous file with comments | « components/ukm/test_ukm_service.cc ('k') | components/ukm/ukm_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698