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

Side by Side Diff: components/ukm/public/ukm_recorder.cc

Issue 2893943004: Refactor UKM interface for mojo-ification (Closed)
Patch Set: Fixed contextualsearch Created 3 years, 7 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/public/ukm_recorder.h ('k') | components/ukm/test_ukm_recorder.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "components/ukm/public/ukm_recorder.h"
6
7 #include "base/atomic_sequence_num.h"
8 #include "base/bind.h"
9 #include "base/feature_list.h"
10 #include "base/memory/ptr_util.h"
11 #include "components/ukm/public/ukm_entry_builder.h"
12
13 namespace ukm {
14
15 const base::Feature kUkmFeature = {"Ukm", base::FEATURE_DISABLED_BY_DEFAULT};
16
17 UkmRecorder::UkmRecorder() = default;
18 UkmRecorder::~UkmRecorder() = default;
19
20 // static
21 ukm::SourceId UkmRecorder::GetNewSourceID() {
22 static base::StaticAtomicSequenceNumber seq;
23 return static_cast<ukm::SourceId>(seq.GetNext());
24 }
25
26 std::unique_ptr<UkmEntryBuilder> UkmRecorder::GetEntryBuilder(
27 ukm::SourceId source_id,
28 const char* event_name) {
29 return base::MakeUnique<UkmEntryBuilder>(
30 base::Bind(&UkmRecorder::AddEntry, base::Unretained(this)), source_id,
31 event_name);
32 }
33
34 } // namespace ukm
OLDNEW
« no previous file with comments | « components/ukm/public/ukm_recorder.h ('k') | components/ukm/test_ukm_recorder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698