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

Side by Side Diff: components/ukm/ukm_source.cc

Issue 2719823003: Convert first contentful paint logging to the new UKM client API (Closed)
Patch Set: renames 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 unified diff | Download patch
« no previous file with comments | « components/ukm/ukm_source.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "components/ukm/ukm_source.h" 5 #include "components/ukm/ukm_source.h"
6 6
7 #include "base/hash.h" 7 #include "base/hash.h"
8 #include "components/metrics/proto/ukm/source.pb.h" 8 #include "components/metrics/proto/ukm/source.pb.h"
9 9
10 namespace ukm { 10 namespace ukm {
11 11
12 UkmSource::UkmSource() = default; 12 UkmSource::UkmSource() = default;
13 13
14 UkmSource::~UkmSource() = default; 14 UkmSource::~UkmSource() = default;
15 15
16 void UkmSource::PopulateProto(Source* proto_source) { 16 void UkmSource::PopulateProto(Source* proto_source) const {
17 DCHECK(!proto_source->has_id()); 17 DCHECK(!proto_source->has_id());
18 DCHECK(!proto_source->has_url()); 18 DCHECK(!proto_source->has_url());
19 19
20 proto_source->set_id(id_); 20 proto_source->set_id(id_);
21 proto_source->set_url(committed_url_.spec()); 21 proto_source->set_url(url_.spec());
22 proto_source->set_first_contentful_paint_msec(
23 first_contentful_paint_.InMilliseconds());
24 } 22 }
25 23
26 } // namespace ukm 24 } // namespace ukm
OLDNEW
« no previous file with comments | « components/ukm/ukm_source.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698