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

Side by Side Diff: chrome/browser/metrics/metrics_service.h

Issue 299153004: Move child process observing from MetricsService to stability provider. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 6 years, 7 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 CHROME_BROWSER_METRICS_METRICS_SERVICE_H_ 8 #ifndef CHROME_BROWSER_METRICS_METRICS_SERVICE_H_
9 #define CHROME_BROWSER_METRICS_METRICS_SERVICE_H_ 9 #define CHROME_BROWSER_METRICS_METRICS_SERVICE_H_
10 10
(...skipping 14 matching lines...) Expand all
25 #include "base/observer_list.h" 25 #include "base/observer_list.h"
26 #include "base/strings/string16.h" 26 #include "base/strings/string16.h"
27 #include "base/threading/thread_checker.h" 27 #include "base/threading/thread_checker.h"
28 #include "base/time/time.h" 28 #include "base/time/time.h"
29 #include "chrome/browser/metrics/metrics_log.h" 29 #include "chrome/browser/metrics/metrics_log.h"
30 #include "chrome/browser/metrics/tracking_synchronizer_observer.h" 30 #include "chrome/browser/metrics/tracking_synchronizer_observer.h"
31 #include "components/metrics/metrics_log_manager.h" 31 #include "components/metrics/metrics_log_manager.h"
32 #include "components/metrics/metrics_provider.h" 32 #include "components/metrics/metrics_provider.h"
33 #include "components/metrics/metrics_service_observer.h" 33 #include "components/metrics/metrics_service_observer.h"
34 #include "components/variations/active_field_trials.h" 34 #include "components/variations/active_field_trials.h"
35 #include "content/public/browser/browser_child_process_observer.h"
36 #include "content/public/browser/user_metrics.h"
37 #include "net/url_request/url_fetcher_delegate.h" 35 #include "net/url_request/url_fetcher_delegate.h"
38 36
39 class GoogleUpdateMetricsProviderWin; 37 class GoogleUpdateMetricsProviderWin;
40 class MetricsReportingScheduler; 38 class MetricsReportingScheduler;
41 class PrefService; 39 class PrefService;
42 class PrefRegistrySimple; 40 class PrefRegistrySimple;
43 class PluginMetricsProvider; 41 class PluginMetricsProvider;
44 42
45 namespace base { 43 namespace base {
46 class DictionaryValue; 44 class DictionaryValue;
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 82
85 // This constructor is private specifically so as to control which code is 83 // This constructor is private specifically so as to control which code is
86 // able to access it. New code that wishes to use it should be added as a 84 // able to access it. New code that wishes to use it should be added as a
87 // friend class. 85 // friend class.
88 SyntheticTrialGroup(uint32 trial, uint32 group); 86 SyntheticTrialGroup(uint32 trial, uint32 group);
89 }; 87 };
90 88
91 class MetricsService 89 class MetricsService
92 : public base::HistogramFlattener, 90 : public base::HistogramFlattener,
93 public chrome_browser_metrics::TrackingSynchronizerObserver, 91 public chrome_browser_metrics::TrackingSynchronizerObserver,
94 public content::BrowserChildProcessObserver,
95 public net::URLFetcherDelegate { 92 public net::URLFetcherDelegate {
96 public: 93 public:
97 // The execution phase of the browser. 94 // The execution phase of the browser.
98 enum ExecutionPhase { 95 enum ExecutionPhase {
99 UNINITIALIZED_PHASE = 0, 96 UNINITIALIZED_PHASE = 0,
100 START_METRICS_RECORDING = 100, 97 START_METRICS_RECORDING = 100,
101 CREATE_PROFILE = 200, 98 CREATE_PROFILE = 200,
102 STARTUP_TIMEBOMB_ARM = 300, 99 STARTUP_TIMEBOMB_ARM = 300,
103 THREAD_WATCHER_START = 400, 100 THREAD_WATCHER_START = 400,
104 MAIN_MESSAGE_LOOP_RUN = 500, 101 MAIN_MESSAGE_LOOP_RUN = 500,
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
164 161
165 // HistogramFlattener: 162 // HistogramFlattener:
166 virtual void RecordDelta(const base::HistogramBase& histogram, 163 virtual void RecordDelta(const base::HistogramBase& histogram,
167 const base::HistogramSamples& snapshot) OVERRIDE; 164 const base::HistogramSamples& snapshot) OVERRIDE;
168 virtual void InconsistencyDetected( 165 virtual void InconsistencyDetected(
169 base::HistogramBase::Inconsistency problem) OVERRIDE; 166 base::HistogramBase::Inconsistency problem) OVERRIDE;
170 virtual void UniqueInconsistencyDetected( 167 virtual void UniqueInconsistencyDetected(
171 base::HistogramBase::Inconsistency problem) OVERRIDE; 168 base::HistogramBase::Inconsistency problem) OVERRIDE;
172 virtual void InconsistencyDetectedInLoggedCount(int amount) OVERRIDE; 169 virtual void InconsistencyDetectedInLoggedCount(int amount) OVERRIDE;
173 170
174 // Implementation of content::BrowserChildProcessObserver
175 virtual void BrowserChildProcessCrashed(
176 const content::ChildProcessData& data) OVERRIDE;
177
178 // This should be called when the application is not idle, i.e. the user seems 171 // This should be called when the application is not idle, i.e. the user seems
179 // to be interacting with the application. 172 // to be interacting with the application.
180 void OnApplicationNotIdle(); 173 void OnApplicationNotIdle();
181 174
182 // Invoked when we get a WM_SESSIONEND. This places a value in prefs that is 175 // Invoked when we get a WM_SESSIONEND. This places a value in prefs that is
183 // reset when RecordCompletedSessionEnd is invoked. 176 // reset when RecordCompletedSessionEnd is invoked.
184 void RecordStartOfSessionEnd(); 177 void RecordStartOfSessionEnd();
185 178
186 // This should be called when the application is shutting down. It records 179 // This should be called when the application is shutting down. It records
187 // that session end was successful. 180 // that session end was successful.
(...skipping 339 matching lines...) Expand 10 before | Expand all | Expand 10 after
527 FRIEND_TEST_ALL_PREFIXES(MetricsServiceTest, IsPluginProcess); 520 FRIEND_TEST_ALL_PREFIXES(MetricsServiceTest, IsPluginProcess);
528 FRIEND_TEST_ALL_PREFIXES(MetricsServiceTest, MetricsServiceObserver); 521 FRIEND_TEST_ALL_PREFIXES(MetricsServiceTest, MetricsServiceObserver);
529 FRIEND_TEST_ALL_PREFIXES(MetricsServiceTest, 522 FRIEND_TEST_ALL_PREFIXES(MetricsServiceTest,
530 PermutedEntropyCacheClearedWhenLowEntropyReset); 523 PermutedEntropyCacheClearedWhenLowEntropyReset);
531 FRIEND_TEST_ALL_PREFIXES(MetricsServiceTest, RegisterSyntheticTrial); 524 FRIEND_TEST_ALL_PREFIXES(MetricsServiceTest, RegisterSyntheticTrial);
532 525
533 DISALLOW_COPY_AND_ASSIGN(MetricsService); 526 DISALLOW_COPY_AND_ASSIGN(MetricsService);
534 }; 527 };
535 528
536 #endif // CHROME_BROWSER_METRICS_METRICS_SERVICE_H_ 529 #endif // CHROME_BROWSER_METRICS_METRICS_SERVICE_H_
OLDNEW
« no previous file with comments | « chrome/browser/metrics/chrome_stability_metrics_provider.cc ('k') | chrome/browser/metrics/metrics_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698