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