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 <map> | 11 #include <map> |
12 #include <string> | 12 #include <string> |
13 #include <vector> | 13 #include <vector> |
14 | 14 |
15 #include "base/basictypes.h" | 15 #include "base/basictypes.h" |
16 #include "base/gtest_prod_util.h" | 16 #include "base/gtest_prod_util.h" |
17 #include "base/memory/scoped_ptr.h" | 17 #include "base/memory/scoped_ptr.h" |
18 #include "base/memory/scoped_vector.h" | 18 #include "base/memory/scoped_vector.h" |
19 #include "base/memory/weak_ptr.h" | 19 #include "base/memory/weak_ptr.h" |
20 #include "base/metrics/field_trial.h" | 20 #include "base/metrics/field_trial.h" |
21 #include "base/metrics/histogram_flattener.h" | 21 #include "base/metrics/histogram_flattener.h" |
22 #include "base/metrics/histogram_snapshot_manager.h" | 22 #include "base/metrics/histogram_snapshot_manager.h" |
23 #include "base/metrics/user_metrics.h" | 23 #include "base/metrics/user_metrics.h" |
24 #include "base/time/time.h" | 24 #include "base/time/time.h" |
| 25 #include "components/metrics/clean_exit_beacon.h" |
25 #include "components/metrics/metrics_log.h" | 26 #include "components/metrics/metrics_log.h" |
26 #include "components/metrics/metrics_log_manager.h" | 27 #include "components/metrics/metrics_log_manager.h" |
27 #include "components/metrics/metrics_provider.h" | 28 #include "components/metrics/metrics_provider.h" |
28 #include "components/variations/active_field_trials.h" | 29 #include "components/variations/active_field_trials.h" |
29 | 30 |
30 class MetricsServiceAccessor; | 31 class MetricsServiceAccessor; |
31 class PrefService; | 32 class PrefService; |
32 class PrefRegistrySimple; | 33 class PrefRegistrySimple; |
33 | 34 |
34 namespace base { | 35 namespace base { |
(...skipping 348 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
383 | 384 |
384 // Used to interact with the embedder. Weak pointer; must outlive |this| | 385 // Used to interact with the embedder. Weak pointer; must outlive |this| |
385 // instance. | 386 // instance. |
386 MetricsServiceClient* const client_; | 387 MetricsServiceClient* const client_; |
387 | 388 |
388 // Registered metrics providers. | 389 // Registered metrics providers. |
389 ScopedVector<MetricsProvider> metrics_providers_; | 390 ScopedVector<MetricsProvider> metrics_providers_; |
390 | 391 |
391 PrefService* local_state_; | 392 PrefService* local_state_; |
392 | 393 |
| 394 CleanExitBeacon clean_exit_beacon_; |
| 395 |
393 base::ActionCallback action_callback_; | 396 base::ActionCallback action_callback_; |
394 | 397 |
395 // Indicate whether recording and reporting are currently happening. | 398 // Indicate whether recording and reporting are currently happening. |
396 // These should not be set directly, but by calling SetRecording and | 399 // These should not be set directly, but by calling SetRecording and |
397 // SetReporting. | 400 // SetReporting. |
398 bool recording_active_; | 401 bool recording_active_; |
399 bool reporting_active_; | 402 bool reporting_active_; |
400 | 403 |
401 // Indicate whether test mode is enabled, where the initial log should never | 404 // Indicate whether test mode is enabled, where the initial log should never |
402 // be cut, and logs are neither persisted nor uploaded. | 405 // be cut, and logs are neither persisted nor uploaded. |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
460 FRIEND_TEST_ALL_PREFIXES(MetricsServiceTest, | 463 FRIEND_TEST_ALL_PREFIXES(MetricsServiceTest, |
461 PermutedEntropyCacheClearedWhenLowEntropyReset); | 464 PermutedEntropyCacheClearedWhenLowEntropyReset); |
462 FRIEND_TEST_ALL_PREFIXES(MetricsServiceTest, RegisterSyntheticTrial); | 465 FRIEND_TEST_ALL_PREFIXES(MetricsServiceTest, RegisterSyntheticTrial); |
463 | 466 |
464 DISALLOW_COPY_AND_ASSIGN(MetricsService); | 467 DISALLOW_COPY_AND_ASSIGN(MetricsService); |
465 }; | 468 }; |
466 | 469 |
467 } // namespace metrics | 470 } // namespace metrics |
468 | 471 |
469 #endif // COMPONENTS_METRICS_METRICS_SERVICE_H_ | 472 #endif // COMPONENTS_METRICS_METRICS_SERVICE_H_ |
OLD | NEW |