| 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 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 386 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 397 // Called when Chrome shuts down. | 397 // Called when Chrome shuts down. |
| 398 void PushPendingLogsToPersistentStorage(); | 398 void PushPendingLogsToPersistentStorage(); |
| 399 | 399 |
| 400 // Ensures that scheduler is running, assuming the current settings are such | 400 // Ensures that scheduler is running, assuming the current settings are such |
| 401 // that metrics should be reported. If not, this is a no-op. | 401 // that metrics should be reported. If not, this is a no-op. |
| 402 void StartSchedulerIfNecessary(); | 402 void StartSchedulerIfNecessary(); |
| 403 | 403 |
| 404 // Starts the process of uploading metrics data. | 404 // Starts the process of uploading metrics data. |
| 405 void StartScheduledUpload(); | 405 void StartScheduledUpload(); |
| 406 | 406 |
| 407 // Starts collecting any data that should be added to a log just before it is | 407 // Called by the client when final log info collection is complete. |
| 408 // closed. | |
| 409 void StartFinalLogInfoCollection(); | |
| 410 // Callbacks for various stages of final log info collection. Do not call | |
| 411 // these directly. | |
| 412 void OnMemoryDetailCollectionDone(); | |
| 413 void OnHistogramSynchronizationDone(); | |
| 414 void OnFinalLogInfoCollectionDone(); | 408 void OnFinalLogInfoCollectionDone(); |
| 415 | 409 |
| 416 // Either closes the current log or creates and closes the initial log | 410 // Either closes the current log or creates and closes the initial log |
| 417 // (depending on |state_|), and stages it for upload. | 411 // (depending on |state_|), and stages it for upload. |
| 418 void StageNewLog(); | 412 void StageNewLog(); |
| 419 | 413 |
| 420 // Prepares the initial stability log, which is only logged when the previous | 414 // Prepares the initial stability log, which is only logged when the previous |
| 421 // run of Chrome crashed. This log contains any stability metrics left over | 415 // run of Chrome crashed. This log contains any stability metrics left over |
| 422 // from that previous run, and only these stability metrics. It uses the | 416 // from that previous run, and only these stability metrics. It uses the |
| 423 // system profile from the previous session. | 417 // system profile from the previous session. |
| (...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 575 // this factory are invalidated in ScheduleNextStateSave. | 569 // this factory are invalidated in ScheduleNextStateSave. |
| 576 base::WeakPtrFactory<MetricsService> state_saver_factory_; | 570 base::WeakPtrFactory<MetricsService> state_saver_factory_; |
| 577 | 571 |
| 578 // The scheduler for determining when uploads should happen. | 572 // The scheduler for determining when uploads should happen. |
| 579 scoped_ptr<MetricsReportingScheduler> scheduler_; | 573 scoped_ptr<MetricsReportingScheduler> scheduler_; |
| 580 | 574 |
| 581 // Indicates that an asynchronous reporting step is running. | 575 // Indicates that an asynchronous reporting step is running. |
| 582 // This is used only for debugging. | 576 // This is used only for debugging. |
| 583 bool waiting_for_asynchronous_reporting_step_; | 577 bool waiting_for_asynchronous_reporting_step_; |
| 584 | 578 |
| 585 // Number of async histogram fetch requests in progress. | |
| 586 int num_async_histogram_fetches_in_progress_; | |
| 587 | |
| 588 // Stores the time of the first call to |GetUptimes()|. | 579 // Stores the time of the first call to |GetUptimes()|. |
| 589 base::TimeTicks first_updated_time_; | 580 base::TimeTicks first_updated_time_; |
| 590 | 581 |
| 591 // Stores the time of the last call to |GetUptimes()|. | 582 // Stores the time of the last call to |GetUptimes()|. |
| 592 base::TimeTicks last_updated_time_; | 583 base::TimeTicks last_updated_time_; |
| 593 | 584 |
| 594 // Execution phase the browser is in. | 585 // Execution phase the browser is in. |
| 595 static ExecutionPhase execution_phase_; | 586 static ExecutionPhase execution_phase_; |
| 596 | 587 |
| 597 // Reduntant marker to check that we completed our shutdown, and set the | 588 // Reduntant marker to check that we completed our shutdown, and set the |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 647 | 638 |
| 648 // Registers/unregisters |observer| to receive MetricsLog notifications | 639 // Registers/unregisters |observer| to receive MetricsLog notifications |
| 649 // from metrics service. | 640 // from metrics service. |
| 650 static void AddMetricsServiceObserver(MetricsServiceObserver* observer); | 641 static void AddMetricsServiceObserver(MetricsServiceObserver* observer); |
| 651 static void RemoveMetricsServiceObserver(MetricsServiceObserver* observer); | 642 static void RemoveMetricsServiceObserver(MetricsServiceObserver* observer); |
| 652 | 643 |
| 653 DISALLOW_IMPLICIT_CONSTRUCTORS(MetricsServiceHelper); | 644 DISALLOW_IMPLICIT_CONSTRUCTORS(MetricsServiceHelper); |
| 654 }; | 645 }; |
| 655 | 646 |
| 656 #endif // CHROME_BROWSER_METRICS_METRICS_SERVICE_H_ | 647 #endif // CHROME_BROWSER_METRICS_METRICS_SERVICE_H_ |
| OLD | NEW |