• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright 2014 The Chromium Authors
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/metrics/metrics_log_manager.h"
6 
7 #include <algorithm>
8 #include <utility>
9 
10 #include "base/strings/string_util.h"
11 #include "components/metrics/metrics_log.h"
12 #include "components/metrics/metrics_log_store.h"
13 #include "components/metrics/metrics_pref_names.h"
14 
15 namespace metrics {
16 
17 MetricsLogManager::MetricsLogManager() = default;
18 
19 MetricsLogManager::~MetricsLogManager() = default;
20 
BeginLoggingWithLog(std::unique_ptr<MetricsLog> log)21 void MetricsLogManager::BeginLoggingWithLog(std::unique_ptr<MetricsLog> log) {
22   DCHECK(!current_log_);
23   current_log_ = std::move(log);
24 }
25 
ReleaseCurrentLog()26 std::unique_ptr<MetricsLog> MetricsLogManager::ReleaseCurrentLog() {
27   DCHECK(current_log_);
28   return std::move(current_log_);
29 }
30 
31 }  // namespace metrics
32