OLD | NEW |
---|---|
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 set of user experience metrics data recorded by | 5 // This file defines a set of user experience metrics data recorded by |
6 // the MetricsService. This is the unit of data that is sent to the server. | 6 // the MetricsService. This is the unit of data that is sent to the server. |
7 | 7 |
8 #ifndef CHROME_BROWSER_METRICS_METRICS_LOG_H_ | 8 #ifndef CHROME_BROWSER_METRICS_METRICS_LOG_H_ |
9 #define CHROME_BROWSER_METRICS_METRICS_LOG_H_ | 9 #define CHROME_BROWSER_METRICS_METRICS_LOG_H_ |
10 | 10 |
11 #include <string> | 11 #include <string> |
12 #include <vector> | 12 #include <vector> |
13 | 13 |
14 #include "base/basictypes.h" | 14 #include "base/basictypes.h" |
15 #include "chrome/common/metrics/metrics_log_base.h" | 15 #include "chrome/common/metrics/metrics_log_base.h" |
16 #include "chrome/installer/util/google_update_settings.h" | 16 #include "chrome/installer/util/google_update_settings.h" |
17 #include "content/public/common/process_type.h" | 17 #include "content/public/common/process_type.h" |
18 #include "ui/gfx/size.h" | 18 #include "ui/gfx/size.h" |
19 | 19 |
20 #if defined(OS_CHROMEOS) | 20 #if defined(OS_CHROMEOS) |
21 #include "chrome/browser/metrics/perf_provider_chromeos.h" | 21 #include "chrome/browser/metrics/perf_provider_chromeos.h" |
22 #endif | 22 #endif |
23 | 23 |
24 struct AutocompleteLog; | 24 struct AutocompleteLog; |
25 class MetricsNetworkObserver; | |
25 class PrefService; | 26 class PrefService; |
26 class PrefRegistrySimple; | 27 class PrefRegistrySimple; |
27 | 28 |
28 namespace base { | 29 namespace base { |
29 class DictionaryValue; | 30 class DictionaryValue; |
30 } | 31 } |
31 | 32 |
32 namespace tracked_objects { | 33 namespace tracked_objects { |
33 struct ProcessDataSnapshot; | 34 struct ProcessDataSnapshot; |
34 } | 35 } |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
138 virtual int GetScreenCount() const; | 139 virtual int GetScreenCount() const; |
139 | 140 |
140 // Fills |field_trial_ids| with the list of initialized field trials name and | 141 // Fills |field_trial_ids| with the list of initialized field trials name and |
141 // group ids. | 142 // group ids. |
142 virtual void GetFieldTrialIds( | 143 virtual void GetFieldTrialIds( |
143 std::vector<chrome_variations::ActiveGroupId>* field_trial_ids) const; | 144 std::vector<chrome_variations::ActiveGroupId>* field_trial_ids) const; |
144 | 145 |
145 private: | 146 private: |
146 FRIEND_TEST_ALL_PREFIXES(MetricsLogTest, ChromeOSStabilityData); | 147 FRIEND_TEST_ALL_PREFIXES(MetricsLogTest, ChromeOSStabilityData); |
147 | 148 |
148 class NetworkObserver; | |
149 | |
150 // Writes application stability metrics (as part of the profile log). | 149 // Writes application stability metrics (as part of the profile log). |
151 // NOTE: Has the side-effect of clearing those counts. | 150 // NOTE: Has the side-effect of clearing those counts. |
152 void WriteStabilityElement( | 151 void WriteStabilityElement( |
153 const std::vector<webkit::WebPluginInfo>& plugin_list, | 152 const std::vector<webkit::WebPluginInfo>& plugin_list, |
154 PrefService* pref); | 153 PrefService* pref); |
155 | 154 |
156 // Within stability group, write plugin crash stats. | 155 // Within stability group, write plugin crash stats. |
157 void WritePluginStabilityElements( | 156 void WritePluginStabilityElements( |
158 const std::vector<webkit::WebPluginInfo>& plugin_list, | 157 const std::vector<webkit::WebPluginInfo>& plugin_list, |
159 PrefService* pref); | 158 PrefService* pref); |
(...skipping 23 matching lines...) Expand all Loading... | |
183 | 182 |
184 // Writes metrics for the profile identified by key. This writes all | 183 // Writes metrics for the profile identified by key. This writes all |
185 // key/value pairs in profile_metrics. | 184 // key/value pairs in profile_metrics. |
186 void WriteProfileMetrics(const std::string& key, | 185 void WriteProfileMetrics(const std::string& key, |
187 const base::DictionaryValue& profile_metrics); | 186 const base::DictionaryValue& profile_metrics); |
188 | 187 |
189 // Writes info about the Google Update install that is managing this client. | 188 // Writes info about the Google Update install that is managing this client. |
190 // This is a no-op if called on a non-Windows platform. | 189 // This is a no-op if called on a non-Windows platform. |
191 void WriteGoogleUpdateProto(const GoogleUpdateMetrics& google_update_metrics); | 190 void WriteGoogleUpdateProto(const GoogleUpdateMetrics& google_update_metrics); |
192 | 191 |
193 // Registers as observer with net::NetworkChangeNotifier and keeps track of | 192 scoped_ptr<MetricsNetworkObserver> network_observer_; |
Ilya Sherman
2013/02/13 01:54:33
nit: Docs. Also, can this be a direct variable, i
szym
2013/02/13 05:09:34
Then we have to include the header file.
Ilya Sherman
2013/02/13 08:05:54
Including the header file is fine.
| |
194 // the network environment. | 193 |
195 scoped_ptr<NetworkObserver> network_observer_; | |
196 #if defined(OS_CHROMEOS) | 194 #if defined(OS_CHROMEOS) |
197 metrics::PerfProvider perf_provider_; | 195 metrics::PerfProvider perf_provider_; |
198 #endif | 196 #endif |
199 | 197 |
200 DISALLOW_COPY_AND_ASSIGN(MetricsLog); | 198 DISALLOW_COPY_AND_ASSIGN(MetricsLog); |
201 }; | 199 }; |
202 | 200 |
203 #endif // CHROME_BROWSER_METRICS_METRICS_LOG_H_ | 201 #endif // CHROME_BROWSER_METRICS_METRICS_LOG_H_ |
OLD | NEW |