OLD | NEW |
(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 |
OLD | NEW |