| OLD | NEW |
| (Empty) |
| 1 // Copyright 2015 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 "ui/gl/angle_platform_impl.h" | |
| 6 | |
| 7 #include "base/metrics/histogram.h" | |
| 8 #include "base/metrics/sparse_histogram.h" | |
| 9 | |
| 10 namespace gfx { | |
| 11 | |
| 12 ANGLEPlatformImpl::ANGLEPlatformImpl() { | |
| 13 } | |
| 14 | |
| 15 ANGLEPlatformImpl::~ANGLEPlatformImpl() { | |
| 16 } | |
| 17 | |
| 18 void ANGLEPlatformImpl::histogramCustomCounts(const char* name, | |
| 19 int sample, | |
| 20 int min, | |
| 21 int max, | |
| 22 int bucket_count) { | |
| 23 // Copied from histogram macro, but without the static variable caching | |
| 24 // the histogram because name is dynamic. | |
| 25 base::HistogramBase* counter = base::Histogram::FactoryGet( | |
| 26 name, min, max, bucket_count, | |
| 27 base::HistogramBase::kUmaTargetedHistogramFlag); | |
| 28 DCHECK_EQ(name, counter->histogram_name()); | |
| 29 counter->Add(sample); | |
| 30 } | |
| 31 | |
| 32 void ANGLEPlatformImpl::histogramEnumeration(const char* name, | |
| 33 int sample, | |
| 34 int boundary_value) { | |
| 35 // Copied from histogram macro, but without the static variable caching | |
| 36 // the histogram because name is dynamic. | |
| 37 base::HistogramBase* counter = base::LinearHistogram::FactoryGet( | |
| 38 name, 1, boundary_value, boundary_value + 1, | |
| 39 base::HistogramBase::kUmaTargetedHistogramFlag); | |
| 40 DCHECK_EQ(name, counter->histogram_name()); | |
| 41 counter->Add(sample); | |
| 42 } | |
| 43 | |
| 44 void ANGLEPlatformImpl::histogramSparse(const char* name, int sample) { | |
| 45 // For sparse histograms, we can use the macro, as it does not incorporate a | |
| 46 // static. | |
| 47 UMA_HISTOGRAM_SPARSE_SLOWLY(name, sample); | |
| 48 } | |
| 49 | |
| 50 } // namespace gfx | |
| OLD | NEW |