| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "base/metrics/statistics_recorder.h" | 5 #include "base/metrics/statistics_recorder.h" |
| 6 | 6 |
| 7 #include "base/at_exit.h" | 7 #include "base/at_exit.h" |
| 8 #include "base/debug/leak_annotations.h" | 8 #include "base/debug/leak_annotations.h" |
| 9 #include "base/json/string_escape.h" | 9 #include "base/json/string_escape.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 } // namespace | 24 } // namespace |
| 25 | 25 |
| 26 namespace base { | 26 namespace base { |
| 27 | 27 |
| 28 // static | 28 // static |
| 29 void StatisticsRecorder::Initialize() { | 29 void StatisticsRecorder::Initialize() { |
| 30 // Ensure that an instance of the StatisticsRecorder object is created. | 30 // Ensure that an instance of the StatisticsRecorder object is created. |
| 31 g_statistics_recorder_.Get(); | 31 g_statistics_recorder_.Get(); |
| 32 } | 32 } |
| 33 | 33 |
| 34 | |
| 35 // static | 34 // static |
| 36 bool StatisticsRecorder::IsActive() { | 35 bool StatisticsRecorder::IsActive() { |
| 37 if (lock_ == NULL) | 36 if (lock_ == NULL) |
| 38 return false; | 37 return false; |
| 39 base::AutoLock auto_lock(*lock_); | 38 base::AutoLock auto_lock(*lock_); |
| 40 return NULL != histograms_; | 39 return NULL != histograms_; |
| 41 } | 40 } |
| 42 | 41 |
| 43 // static | 42 // static |
| 44 HistogramBase* StatisticsRecorder::RegisterOrDeleteDuplicate( | 43 HistogramBase* StatisticsRecorder::RegisterOrDeleteDuplicate( |
| (...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 314 | 313 |
| 315 | 314 |
| 316 // static | 315 // static |
| 317 StatisticsRecorder::HistogramMap* StatisticsRecorder::histograms_ = NULL; | 316 StatisticsRecorder::HistogramMap* StatisticsRecorder::histograms_ = NULL; |
| 318 // static | 317 // static |
| 319 StatisticsRecorder::RangesMap* StatisticsRecorder::ranges_ = NULL; | 318 StatisticsRecorder::RangesMap* StatisticsRecorder::ranges_ = NULL; |
| 320 // static | 319 // static |
| 321 base::Lock* StatisticsRecorder::lock_ = NULL; | 320 base::Lock* StatisticsRecorder::lock_ = NULL; |
| 322 | 321 |
| 323 } // namespace base | 322 } // namespace base |
| OLD | NEW |