OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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_POLICY_POLICY_LOAD_STATUS_H_ | 5 #ifndef COMPONENTS_POLICY_CORE_COMMON_POLICY_LOAD_STATUS_H_ |
6 #define CHROME_BROWSER_POLICY_POLICY_LOAD_STATUS_H_ | 6 #define COMPONENTS_POLICY_CORE_COMMON_POLICY_LOAD_STATUS_H_ |
7 | 7 |
8 #include <bitset> | 8 #include <bitset> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| 11 #include "components/policy/policy_export.h" |
11 | 12 |
12 namespace base { | 13 namespace base { |
13 class HistogramBase; | 14 class HistogramBase; |
14 } | 15 } |
15 | 16 |
16 namespace policy { | 17 namespace policy { |
17 | 18 |
18 // UMA histogram enum for policy load status. Don't change existing constants, | 19 // UMA histogram enum for policy load status. Don't change existing constants, |
19 // append additional constants to the end if needed. | 20 // append additional constants to the end if needed. |
20 enum PolicyLoadStatus { | 21 enum PolicyLoadStatus { |
(...skipping 18 matching lines...) Expand all Loading... |
39 // Parse error. | 40 // Parse error. |
40 POLICY_LOAD_STATUS_PARSE_ERROR, | 41 POLICY_LOAD_STATUS_PARSE_ERROR, |
41 | 42 |
42 // This must stay last. | 43 // This must stay last. |
43 POLICY_LOAD_STATUS_SIZE | 44 POLICY_LOAD_STATUS_SIZE |
44 }; | 45 }; |
45 | 46 |
46 // A helper for generating policy load status UMA statistics that'll collect | 47 // A helper for generating policy load status UMA statistics that'll collect |
47 // histogram samples for a policy load operation and records histogram samples | 48 // histogram samples for a policy load operation and records histogram samples |
48 // for the status codes that were seen on destruction. | 49 // for the status codes that were seen on destruction. |
49 class PolicyLoadStatusSample { | 50 class POLICY_EXPORT PolicyLoadStatusSample { |
50 public: | 51 public: |
51 PolicyLoadStatusSample(); | 52 PolicyLoadStatusSample(); |
52 ~PolicyLoadStatusSample(); | 53 ~PolicyLoadStatusSample(); |
53 | 54 |
54 // Adds a status code. | 55 // Adds a status code. |
55 void Add(PolicyLoadStatus status); | 56 void Add(PolicyLoadStatus status); |
56 | 57 |
57 private: | 58 private: |
58 std::bitset<POLICY_LOAD_STATUS_SIZE> status_bits_; | 59 std::bitset<POLICY_LOAD_STATUS_SIZE> status_bits_; |
59 base::HistogramBase* histogram_; | 60 base::HistogramBase* histogram_; |
60 | 61 |
61 DISALLOW_COPY_AND_ASSIGN(PolicyLoadStatusSample); | 62 DISALLOW_COPY_AND_ASSIGN(PolicyLoadStatusSample); |
62 }; | 63 }; |
63 | 64 |
64 } // namespace policy | 65 } // namespace policy |
65 | 66 |
66 #endif // CHROME_BROWSER_POLICY_POLICY_LOAD_STATUS_H_ | 67 #endif // COMPONENTS_POLICY_CORE_COMMON_POLICY_LOAD_STATUS_H_ |
OLD | NEW |