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

Unified Diff: components/ukm/ukm_service.h

Issue 2737953002: UKM: Remove UkmService::RecordSource (Closed)
Patch Set: 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
Index: components/ukm/ukm_service.h
diff --git a/components/ukm/ukm_service.h b/components/ukm/ukm_service.h
index 3431b672bbc360c1fc6ea357e246cf4166ffb53c..4094b2162ec114b7867e7be888989133bf3ac975 100644
--- a/components/ukm/ukm_service.h
+++ b/components/ukm/ukm_service.h
@@ -95,7 +95,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_;
}
@@ -121,11 +122,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();
@@ -185,8 +181,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

Powered by Google App Engine
This is Rietveld 408576698