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 334 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
345 // the log manager, staging it if necessary. | 345 // the log manager, staging it if necessary. |
346 void SendNextLog(); | 346 void SendNextLog(); |
347 | 347 |
348 // Returns true if any of the registered metrics providers have critical | 348 // Returns true if any of the registered metrics providers have critical |
349 // stability metrics to report in an initial stability log. | 349 // stability metrics to report in an initial stability log. |
350 bool ProvidersHaveInitialStabilityMetrics(); | 350 bool ProvidersHaveInitialStabilityMetrics(); |
351 | 351 |
352 // Prepares the initial stability log, which is only logged when the previous | 352 // Prepares the initial stability log, which is only logged when the previous |
353 // run of Chrome crashed. This log contains any stability metrics left over | 353 // run of Chrome crashed. This log contains any stability metrics left over |
354 // from that previous run, and only these stability metrics. It uses the | 354 // from that previous run, and only these stability metrics. It uses the |
355 // system profile from the previous session. Returns true if a log was | 355 // system profile from the previous session. |prefs_previous_version| is used |
356 // created. | 356 // to validate the version number recovered from the system profile. Returns |
357 bool PrepareInitialStabilityLog(); | 357 // true if a log was created. |
| 358 bool PrepareInitialStabilityLog(const std::string& prefs_previous_version); |
358 | 359 |
359 // Prepares the initial metrics log, which includes startup histograms and | 360 // Prepares the initial metrics log, which includes startup histograms and |
360 // profiler data, as well as incremental stability-related metrics. | 361 // profiler data, as well as incremental stability-related metrics. |
361 void PrepareInitialMetricsLog(); | 362 void PrepareInitialMetricsLog(); |
362 | 363 |
363 // Uploads the currently staged log (which must be non-null). | 364 // Uploads the currently staged log (which must be non-null). |
364 void SendStagedLog(); | 365 void SendStagedLog(); |
365 | 366 |
366 // Called after transmission completes (either successfully or with failure). | 367 // Called after transmission completes (either successfully or with failure). |
367 void OnLogUploadComplete(int response_code); | 368 void OnLogUploadComplete(int response_code); |
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
507 // Weak pointers factory used for saving state. All weak pointers managed by | 508 // Weak pointers factory used for saving state. All weak pointers managed by |
508 // this factory are invalidated in ScheduleNextStateSave. | 509 // this factory are invalidated in ScheduleNextStateSave. |
509 base::WeakPtrFactory<MetricsService> state_saver_factory_; | 510 base::WeakPtrFactory<MetricsService> state_saver_factory_; |
510 | 511 |
511 DISALLOW_COPY_AND_ASSIGN(MetricsService); | 512 DISALLOW_COPY_AND_ASSIGN(MetricsService); |
512 }; | 513 }; |
513 | 514 |
514 } // namespace metrics | 515 } // namespace metrics |
515 | 516 |
516 #endif // COMPONENTS_METRICS_METRICS_SERVICE_H_ | 517 #endif // COMPONENTS_METRICS_METRICS_SERVICE_H_ |
OLD | NEW |