Chromium Code Reviews| Index: base/metrics/chromeos_metrics.h |
| diff --git a/base/metrics/chromeos_metrics.h b/base/metrics/chromeos_metrics.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..cad68dab5f394cb9dd048c6a48f72b77e77e3070 |
| --- /dev/null |
| +++ b/base/metrics/chromeos_metrics.h |
| @@ -0,0 +1,35 @@ |
| +// Copyright (c) 2014 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +# ifndef BASE_METRICS_CHROMEOS_METRICS_H_ |
| +# define BASE_METRICS_CHROMEOS_METRICS_H_ |
| + |
| +#include <fcntl.h> |
|
achaulk
2014/04/07 22:16:00
Typically the style is to forward declare as much
|
| +#include <list> |
| + |
| +#include "base/base_export.h" |
| +#include "base/files/file_path.h" |
| +#include "base/memory/scoped_vector.h" |
| +#include "base/metrics/crash_sample.h" |
| +#include "base/metrics/metric_sample.h" |
| + |
| +namespace base { |
| +class BASE_EXPORT ChromeOSMetrics { |
| + public: |
| + // static |
| + static MetricSample* ReadMessage(int fd); |
|
achaulk
2014/04/07 22:16:00
Since everything is static, why not just have this
|
| + static MetricSample* ReadSample(int32_t message_size, uint8* buffer); |
| + static void ReadMetricsFromFile(const std::string& filename, |
| + ScopedVector<MetricSample>* metrics); |
| + static int32_t FormatSample(int32_t buffer_size, char* buffer, |
| + const char* format, ...); |
| + static int32_t WriteChromeMessage(MetricSample* sample, int32_t buffer_size, |
| + char* buffer); |
| + static bool WriteMetricToFile(MetricSample* sample, |
| + const std::string& filename); |
| + private: |
| + static const int kMessageMaxLength = 1024; |
| +}; |
| +} // namespace base |
| +# endif // BASE_METRICS_CHROMEOS_METRICS_H_ |