| 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 #ifndef CHROME_BROWSER_EXTENSIONS_API_METRICS_METRICS_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_API_METRICS_METRICS_H_ |
| 6 #define CHROME_BROWSER_EXTENSIONS_API_METRICS_METRICS_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_API_METRICS_METRICS_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/metrics/histogram.h" | 10 #include "base/metrics/histogram.h" |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 | 21 |
| 22 // ExtensionFunction: | 22 // ExtensionFunction: |
| 23 virtual bool RunImpl() OVERRIDE; | 23 virtual bool RunImpl() OVERRIDE; |
| 24 }; | 24 }; |
| 25 | 25 |
| 26 class MetricsHistogramHelperFunction : public SyncExtensionFunction { | 26 class MetricsHistogramHelperFunction : public SyncExtensionFunction { |
| 27 protected: | 27 protected: |
| 28 virtual ~MetricsHistogramHelperFunction() {} | 28 virtual ~MetricsHistogramHelperFunction() {} |
| 29 bool GetNameAndSample(std::string* name, int* sample); | 29 bool GetNameAndSample(std::string* name, int* sample); |
| 30 virtual bool RecordValue(const std::string& name, | 30 virtual bool RecordValue(const std::string& name, |
| 31 base::Histogram::ClassType type, | 31 base::HistogramType type, |
| 32 int min, int max, size_t buckets, | 32 int min, int max, size_t buckets, |
| 33 int sample); | 33 int sample); |
| 34 }; | 34 }; |
| 35 | 35 |
| 36 class MetricsRecordValueFunction : public MetricsHistogramHelperFunction { | 36 class MetricsRecordValueFunction : public MetricsHistogramHelperFunction { |
| 37 public: | 37 public: |
| 38 DECLARE_EXTENSION_FUNCTION_NAME("metricsPrivate.recordValue") | 38 DECLARE_EXTENSION_FUNCTION_NAME("metricsPrivate.recordValue") |
| 39 | 39 |
| 40 protected: | 40 protected: |
| 41 virtual ~MetricsRecordValueFunction() {} | 41 virtual ~MetricsRecordValueFunction() {} |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 117 protected: | 117 protected: |
| 118 virtual ~MetricsRecordLongTimeFunction() {} | 118 virtual ~MetricsRecordLongTimeFunction() {} |
| 119 | 119 |
| 120 // ExtensionFunction: | 120 // ExtensionFunction: |
| 121 virtual bool RunImpl() OVERRIDE; | 121 virtual bool RunImpl() OVERRIDE; |
| 122 }; | 122 }; |
| 123 | 123 |
| 124 } // namespace extensions | 124 } // namespace extensions |
| 125 | 125 |
| 126 #endif // CHROME_BROWSER_EXTENSIONS_API_METRICS_METRICS_H_ | 126 #endif // CHROME_BROWSER_EXTENSIONS_API_METRICS_METRICS_H_ |
| OLD | NEW |