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

Unified Diff: components/ukm/ukm_service.cc

Issue 2719823003: Convert first contentful paint logging to the new UKM client API (Closed)
Patch Set: migrate to int32_t Created 3 years, 10 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.cc
diff --git a/components/ukm/ukm_service.cc b/components/ukm/ukm_service.cc
index 06c3dbb5f59a60870f12b910eca9dd3289dc12db..3bf440f3a1c80d743370d7cafbbe30a55b298d8e 100644
--- a/components/ukm/ukm_service.cc
+++ b/components/ukm/ukm_service.cc
@@ -229,6 +229,12 @@ void UkmService::RegisterPrefs(PrefRegistrySimple* registry) {
registry->RegisterListPref(prefs::kUkmPersistedLogs);
}
+// static
+int32_t UkmService::NewSourceId() {
+ static int32_t g_source_id_provider = 0;
+ return g_source_id_provider++;
+}
+
void UkmService::StartInitTask() {
DCHECK(thread_checker_.CalledOnValidThread());
DVLOG(1) << "UkmService::StartInitTask";
@@ -387,7 +393,7 @@ void UkmService::UpdateSourceURL(int32_t source_id, const GURL& url) {
if (source_id != source->id())
continue;
- source->set_committed_url(url);
+ source->set_url(url);
return;
}
@@ -397,7 +403,7 @@ void UkmService::UpdateSourceURL(int32_t source_id, const GURL& url) {
}
std::unique_ptr<UkmSource> source = base::MakeUnique<UkmSource>();
source->set_id(source_id);
- source->set_committed_url(url);
+ source->set_url(url);
sources_.push_back(std::move(source));
}

Powered by Google App Engine
This is Rietveld 408576698