| 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 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 191 void ClearSavedStabilityMetrics(); | 191 void ClearSavedStabilityMetrics(); |
| 192 | 192 |
| 193 // Pushes a log that has been generated by an external component. | 193 // Pushes a log that has been generated by an external component. |
| 194 void PushExternalLog(const std::string& log); | 194 void PushExternalLog(const std::string& log); |
| 195 | 195 |
| 196 // Updates data usage tracking prefs with the specified values. | 196 // Updates data usage tracking prefs with the specified values. |
| 197 void UpdateMetricsUsagePrefs(const std::string& service_name, | 197 void UpdateMetricsUsagePrefs(const std::string& service_name, |
| 198 int message_size, | 198 int message_size, |
| 199 bool is_cellular); | 199 bool is_cellular); |
| 200 | 200 |
| 201 // Merge any data from metrics providers into the global StatisticsRecorder. | |
| 202 void MergeHistogramDeltas(); | |
| 203 | |
| 204 protected: | 201 protected: |
| 205 // Exposed for testing. | 202 // Exposed for testing. |
| 206 MetricsLogManager* log_manager() { return &log_manager_; } | 203 MetricsLogManager* log_manager() { return &log_manager_; } |
| 207 | 204 |
| 208 private: | 205 private: |
| 209 friend class MetricsServiceAccessor; | 206 friend class MetricsServiceAccessor; |
| 210 | 207 |
| 211 // The MetricsService has a lifecycle that is stored as a state. | 208 // The MetricsService has a lifecycle that is stored as a state. |
| 212 // See metrics_service.cc for description of this lifecycle. | 209 // See metrics_service.cc for description of this lifecycle. |
| 213 enum State { | 210 enum State { |
| (...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 463 // Weak pointers factory used to post task on different threads. All weak | 460 // Weak pointers factory used to post task on different threads. All weak |
| 464 // pointers managed by this factory have the same lifetime as MetricsService. | 461 // pointers managed by this factory have the same lifetime as MetricsService. |
| 465 base::WeakPtrFactory<MetricsService> self_ptr_factory_; | 462 base::WeakPtrFactory<MetricsService> self_ptr_factory_; |
| 466 | 463 |
| 467 DISALLOW_COPY_AND_ASSIGN(MetricsService); | 464 DISALLOW_COPY_AND_ASSIGN(MetricsService); |
| 468 }; | 465 }; |
| 469 | 466 |
| 470 } // namespace metrics | 467 } // namespace metrics |
| 471 | 468 |
| 472 #endif // COMPONENTS_METRICS_METRICS_SERVICE_H_ | 469 #endif // COMPONENTS_METRICS_METRICS_SERVICE_H_ |
| OLD | NEW |