Chromium Code Reviews| Index: base/metrics/single_value_histograms.cc |
| diff --git a/base/metrics/single_value_histograms.cc b/base/metrics/single_value_histograms.cc |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..79ba94ec7e8673c696ac2e19133809008cb40220 |
| --- /dev/null |
| +++ b/base/metrics/single_value_histograms.cc |
| @@ -0,0 +1,26 @@ |
| +// Copyright 2017 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#include "base/metrics/single_value_histograms.h" |
| + |
| +namespace base { |
| + |
| +static SingleValueHistogramsFactory* g_factory = nullptr; |
| + |
| +// TODO(dalecurtis): What to do about tests that don't have a ChildThread? Now |
| +// we'd need all run_all_unittests.cc to set this up, which is annoying... |
|
Alexei Svitkine (slow)
2017/04/26 18:12:53
Can we have a default factor that creates instance
DaleCurtis
2017/04/29 00:30:35
Done; this also allows reuse of the default implem
|
| + |
| +// static |
| +SingleValueHistogramsFactory* SingleValueHistogramsFactory::Get() { |
| + return g_factory; |
| +} |
| + |
| +// static |
| +void SingleValueHistogramsFactory::SetFactory( |
| + SingleValueHistogramsFactory* factory) { |
| + DCHECK(!g_factory); |
| + g_factory = factory; |
| +} |
| + |
| +} // namespace base |