OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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_CHROMEOS_EXTERNAL_METRICS_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_EXTERNAL_METRICS_H_ |
6 #define CHROME_BROWSER_CHROMEOS_EXTERNAL_METRICS_H_ | 6 #define CHROME_BROWSER_CHROMEOS_EXTERNAL_METRICS_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
| 9 #include <string> |
| 10 |
9 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
10 #include "base/compiler_specific.h" | 12 #include "base/compiler_specific.h" |
11 #include "base/file_path.h" | 13 #include "base/file_path.h" |
12 #include "base/gtest_prod_util.h" | 14 #include "base/gtest_prod_util.h" |
13 #include "base/hash_tables.h" | 15 #include "base/hash_tables.h" |
14 #include "base/task.h" | 16 #include "base/ref_counted.h" |
15 | 17 |
16 namespace chromeos { | 18 namespace chromeos { |
17 | 19 |
18 // ExternalMetrics is a service that Chrome offers to Chrome OS to upload | 20 // ExternalMetrics is a service that Chrome offers to Chrome OS to upload |
19 // metrics to the UMA server on its behalf. Chrome periodically reads the | 21 // metrics to the UMA server on its behalf. Chrome periodically reads the |
20 // content of a well-know file, and parses it into name-value pairs, each | 22 // content of a well-know file, and parses it into name-value pairs, each |
21 // representing a Chrome OS metrics event. The events are logged using the | 23 // representing a Chrome OS metrics event. The events are logged using the |
22 // normal UMA mechanism. The file is then truncated to zero size. Chrome uses | 24 // normal UMA mechanism. The file is then truncated to zero size. Chrome uses |
23 // flock() to synchronize accesses to the file. | 25 // flock() to synchronize accesses to the file. |
24 class ExternalMetrics : public base::RefCountedThreadSafe<ExternalMetrics> { | 26 class ExternalMetrics : public base::RefCountedThreadSafe<ExternalMetrics> { |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
80 | 82 |
81 // Used for testing only. | 83 // Used for testing only. |
82 RecorderType test_recorder_; | 84 RecorderType test_recorder_; |
83 FilePath test_path_; | 85 FilePath test_path_; |
84 DISALLOW_COPY_AND_ASSIGN(ExternalMetrics); | 86 DISALLOW_COPY_AND_ASSIGN(ExternalMetrics); |
85 }; | 87 }; |
86 | 88 |
87 } // namespace chromeos | 89 } // namespace chromeos |
88 | 90 |
89 #endif // CHROME_BROWSER_CHROMEOS_EXTERNAL_METRICS_H_ | 91 #endif // CHROME_BROWSER_CHROMEOS_EXTERNAL_METRICS_H_ |
OLD | NEW |