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

Unified Diff: components/ukm/test_ukm_service.cc

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.h ('k') | components/ukm/ukm_service.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/ukm/test_ukm_service.cc
diff --git a/components/ukm/test_ukm_service.cc b/components/ukm/test_ukm_service.cc
index b22e5f3de101e161dbc724a517e5b0f03ebf4f39..e3fcef8671e1102941eae8d3b541227b3e71d5ad 100644
--- a/components/ukm/test_ukm_service.cc
+++ b/components/ukm/test_ukm_service.cc
@@ -4,6 +4,8 @@
#include "components/ukm/test_ukm_service.h"
+#include "components/ukm/ukm_source.h"
+
namespace ukm {
UkmServiceTestingHarness::UkmServiceTestingHarness() {
@@ -25,8 +27,17 @@ TestUkmService::TestUkmService(PrefService* prefs_service)
TestUkmService::~TestUkmService() = default;
-const UkmSource* TestUkmService::GetSource(size_t source_num) const {
- return sources_for_testing()[source_num].get();
+const std::map<int32_t, std::unique_ptr<UkmSource>>&
+TestUkmService::GetSources() const {
+ return sources_for_testing();
+}
+
+const UkmSource* TestUkmService::GetSourceForUrl(const char* url) const {
+ for (const auto& kv : sources_for_testing()) {
+ if (kv.second->url() == url)
+ return kv.second.get();
+ }
+ return nullptr;
}
const UkmEntry* TestUkmService::GetEntry(size_t entry_num) const {
« no previous file with comments | « components/ukm/test_ukm_service.h ('k') | components/ukm/ukm_service.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698