| 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 |
| (...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 202 void ClearSavedStabilityMetrics(); | 202 void ClearSavedStabilityMetrics(); |
| 203 | 203 |
| 204 // Pushes a log that has been generated by an external component. | 204 // Pushes a log that has been generated by an external component. |
| 205 void PushExternalLog(const std::string& log); | 205 void PushExternalLog(const std::string& log); |
| 206 | 206 |
| 207 // Updates data usage tracking prefs with the specified values. | 207 // Updates data usage tracking prefs with the specified values. |
| 208 void UpdateMetricsUsagePrefs(const std::string& service_name, | 208 void UpdateMetricsUsagePrefs(const std::string& service_name, |
| 209 int message_size, | 209 int message_size, |
| 210 bool is_cellular); | 210 bool is_cellular); |
| 211 | 211 |
| 212 // Merge any data from metrics providers into the global StatisticsRecorder. | |
| 213 void MergeHistogramDeltas(); | |
| 214 | |
| 215 protected: | 212 protected: |
| 216 // Exposed for testing. | 213 // Exposed for testing. |
| 217 MetricsLogManager* log_manager() { return &log_manager_; } | 214 MetricsLogManager* log_manager() { return &log_manager_; } |
| 218 | 215 |
| 219 private: | 216 private: |
| 220 friend class MetricsServiceAccessor; | 217 friend class MetricsServiceAccessor; |
| 221 | 218 |
| 222 // The MetricsService has a lifecycle that is stored as a state. | 219 // The MetricsService has a lifecycle that is stored as a state. |
| 223 // See metrics_service.cc for description of this lifecycle. | 220 // See metrics_service.cc for description of this lifecycle. |
| 224 enum State { | 221 enum State { |
| (...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 477 // Weak pointers factory used to post task on different threads. All weak | 474 // Weak pointers factory used to post task on different threads. All weak |
| 478 // pointers managed by this factory have the same lifetime as MetricsService. | 475 // pointers managed by this factory have the same lifetime as MetricsService. |
| 479 base::WeakPtrFactory<MetricsService> self_ptr_factory_; | 476 base::WeakPtrFactory<MetricsService> self_ptr_factory_; |
| 480 | 477 |
| 481 DISALLOW_COPY_AND_ASSIGN(MetricsService); | 478 DISALLOW_COPY_AND_ASSIGN(MetricsService); |
| 482 }; | 479 }; |
| 483 | 480 |
| 484 } // namespace metrics | 481 } // namespace metrics |
| 485 | 482 |
| 486 #endif // COMPONENTS_METRICS_METRICS_SERVICE_H_ | 483 #endif // COMPONENTS_METRICS_METRICS_SERVICE_H_ |
| OLD | NEW |