OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 "skia/ext/skia_histogram.h" | 5 #include "skia/ext/skia_histogram.h" |
6 | 6 |
7 #include <type_traits> | 7 #include <type_traits> |
8 #include "base/metrics/histogram.h" | 8 #include "base/metrics/histogram_macros.h" |
9 | 9 |
10 // In order to prevent Chrome headers from leaking into Skia, we use a raw | 10 // In order to prevent Chrome headers from leaking into Skia, we use a raw |
11 // intptr_t in the header, rather than the base::subtle::AtomicWord. Make sure | 11 // intptr_t in the header, rather than the base::subtle::AtomicWord. Make sure |
12 // this is a valid assumption. | 12 // this is a valid assumption. |
13 static_assert(std::is_same<intptr_t, base::subtle::AtomicWord>::value, | 13 static_assert(std::is_same<intptr_t, base::subtle::AtomicWord>::value, |
14 "To allow for header decoupling, skia_histogram.h uses intptr_t " | 14 "To allow for header decoupling, skia_histogram.h uses intptr_t " |
15 "instead of a base::subtle::AtomicWord. These must be the same " | 15 "instead of a base::subtle::AtomicWord. These must be the same " |
16 "type"); | 16 "type"); |
17 | 17 |
18 namespace skia { | 18 namespace skia { |
(...skipping 15 matching lines...) Expand all Loading... |
34 const char* name, | 34 const char* name, |
35 int sample, | 35 int sample, |
36 int boundary_value) { | 36 int boundary_value) { |
37 HISTOGRAM_POINTER_USE(atomic_histogram_pointer, name, Add(sample), | 37 HISTOGRAM_POINTER_USE(atomic_histogram_pointer, name, Add(sample), |
38 base::LinearHistogram::FactoryGet( | 38 base::LinearHistogram::FactoryGet( |
39 name, 1, boundary_value, boundary_value + 1, | 39 name, 1, boundary_value, boundary_value + 1, |
40 base::HistogramBase::kUmaTargetedHistogramFlag)); | 40 base::HistogramBase::kUmaTargetedHistogramFlag)); |
41 } | 41 } |
42 | 42 |
43 } // namespace skia | 43 } // namespace skia |
OLD | NEW |