Chromium Code Reviews| 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 "base/metrics/single_value_histograms.h" | |
| 6 | |
| 7 namespace base { | |
| 8 | |
| 9 static SingleValueHistogramsFactory* g_factory = nullptr; | |
| 10 | |
| 11 // TODO(dalecurtis): What to do about tests that don't have a ChildThread? Now | |
| 12 // 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
| |
| 13 | |
| 14 // static | |
| 15 SingleValueHistogramsFactory* SingleValueHistogramsFactory::Get() { | |
| 16 return g_factory; | |
| 17 } | |
| 18 | |
| 19 // static | |
| 20 void SingleValueHistogramsFactory::SetFactory( | |
| 21 SingleValueHistogramsFactory* factory) { | |
| 22 DCHECK(!g_factory); | |
| 23 g_factory = factory; | |
| 24 } | |
| 25 | |
| 26 } // namespace base | |
| OLD | NEW |