Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(501)

Side by Side Diff: components/metrics/metrics_service.h

Issue 558683002: Extract the handling of the clean exit beacon from MetricsService. The extracted implementation sup… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Review comments. Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « components/metrics/clean_exit_beacon.cc ('k') | components/metrics/metrics_service.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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_
OLDNEW
« no previous file with comments | « components/metrics/clean_exit_beacon.cc ('k') | components/metrics/metrics_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698