OLD | NEW |
---|---|
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 // This file defines a service that collects information about the user | 5 // This file defines a service that collects information about the user |
6 // experience in order to help improve future versions of the app. | 6 // experience in order to help improve future versions of the app. |
7 | 7 |
8 #ifndef COMPONENTS_METRICS_METRICS_SERVICE_H_ | 8 #ifndef COMPONENTS_METRICS_METRICS_SERVICE_H_ |
9 #define COMPONENTS_METRICS_METRICS_SERVICE_H_ | 9 #define COMPONENTS_METRICS_METRICS_SERVICE_H_ |
10 | 10 |
11 #include <stdint.h> | 11 #include <stdint.h> |
12 | 12 |
13 #include <map> | 13 #include <map> |
14 #include <set> | |
14 #include <string> | 15 #include <string> |
15 #include <vector> | 16 #include <vector> |
16 | 17 |
17 #include "base/gtest_prod_util.h" | 18 #include "base/gtest_prod_util.h" |
18 #include "base/macros.h" | 19 #include "base/macros.h" |
19 #include "base/memory/scoped_ptr.h" | 20 #include "base/memory/scoped_ptr.h" |
20 #include "base/memory/scoped_vector.h" | 21 #include "base/memory/scoped_vector.h" |
21 #include "base/memory/weak_ptr.h" | 22 #include "base/memory/weak_ptr.h" |
22 #include "base/metrics/field_trial.h" | 23 #include "base/metrics/field_trial.h" |
23 #include "base/metrics/histogram_flattener.h" | 24 #include "base/metrics/histogram_flattener.h" |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
66 UNINITIALIZED_PHASE = 0, | 67 UNINITIALIZED_PHASE = 0, |
67 START_METRICS_RECORDING = 100, | 68 START_METRICS_RECORDING = 100, |
68 CREATE_PROFILE = 200, | 69 CREATE_PROFILE = 200, |
69 STARTUP_TIMEBOMB_ARM = 300, | 70 STARTUP_TIMEBOMB_ARM = 300, |
70 THREAD_WATCHER_START = 400, | 71 THREAD_WATCHER_START = 400, |
71 MAIN_MESSAGE_LOOP_RUN = 500, | 72 MAIN_MESSAGE_LOOP_RUN = 500, |
72 SHUTDOWN_TIMEBOMB_ARM = 600, | 73 SHUTDOWN_TIMEBOMB_ARM = 600, |
73 SHUTDOWN_COMPLETE = 700, | 74 SHUTDOWN_COMPLETE = 700, |
74 }; | 75 }; |
75 | 76 |
77 typedef std::set<base::HistogramBase*> HistogramSet; | |
Alexei Svitkine (slow)
2016/02/18 15:47:40
Doesn't seem like this is used anywhere in this CL
bcwhite
2016/02/18 17:07:05
Removed.
| |
78 | |
76 // Creates the MetricsService with the given |state_manager|, |client|, and | 79 // Creates the MetricsService with the given |state_manager|, |client|, and |
77 // |local_state|. Does not take ownership of the paramaters; instead stores | 80 // |local_state|. Does not take ownership of the paramaters; instead stores |
78 // a weak pointer to each. Caller should ensure that the parameters are valid | 81 // a weak pointer to each. Caller should ensure that the parameters are valid |
79 // for the lifetime of this class. | 82 // for the lifetime of this class. |
80 MetricsService(MetricsStateManager* state_manager, | 83 MetricsService(MetricsStateManager* state_manager, |
81 MetricsServiceClient* client, | 84 MetricsServiceClient* client, |
82 PrefService* local_state); | 85 PrefService* local_state); |
83 ~MetricsService() override; | 86 ~MetricsService() override; |
84 | 87 |
85 // Initializes metrics recording state. Updates various bookkeeping values in | 88 // Initializes metrics recording state. Updates various bookkeeping values in |
(...skipping 398 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
484 // Weak pointers factory used for saving state. All weak pointers managed by | 487 // Weak pointers factory used for saving state. All weak pointers managed by |
485 // this factory are invalidated in ScheduleNextStateSave. | 488 // this factory are invalidated in ScheduleNextStateSave. |
486 base::WeakPtrFactory<MetricsService> state_saver_factory_; | 489 base::WeakPtrFactory<MetricsService> state_saver_factory_; |
487 | 490 |
488 DISALLOW_COPY_AND_ASSIGN(MetricsService); | 491 DISALLOW_COPY_AND_ASSIGN(MetricsService); |
489 }; | 492 }; |
490 | 493 |
491 } // namespace metrics | 494 } // namespace metrics |
492 | 495 |
493 #endif // COMPONENTS_METRICS_METRICS_SERVICE_H_ | 496 #endif // COMPONENTS_METRICS_METRICS_SERVICE_H_ |
OLD | NEW |