| 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 365 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 376 // Called when Chrome shuts down. | 376 // Called when Chrome shuts down. |
| 377 void PushPendingLogsToPersistentStorage(); | 377 void PushPendingLogsToPersistentStorage(); |
| 378 | 378 |
| 379 // Ensures that scheduler is running, assuming the current settings are such | 379 // Ensures that scheduler is running, assuming the current settings are such |
| 380 // that metrics should be reported. If not, this is a no-op. | 380 // that metrics should be reported. If not, this is a no-op. |
| 381 void StartSchedulerIfNecessary(); | 381 void StartSchedulerIfNecessary(); |
| 382 | 382 |
| 383 // Starts the process of uploading metrics data. | 383 // Starts the process of uploading metrics data. |
| 384 void StartScheduledUpload(); | 384 void StartScheduledUpload(); |
| 385 | 385 |
| 386 // Starts collecting any data that should be added to a log just before it is | 386 // Called by the client when final log info collection is complete. |
| 387 // closed. | |
| 388 void StartFinalLogInfoCollection(); | |
| 389 // Callbacks for various stages of final log info collection. Do not call | |
| 390 // these directly. | |
| 391 void OnMemoryDetailCollectionDone(); | |
| 392 void OnHistogramSynchronizationDone(); | |
| 393 void OnFinalLogInfoCollectionDone(); | 387 void OnFinalLogInfoCollectionDone(); |
| 394 | 388 |
| 395 // Either closes the current log or creates and closes the initial log | 389 // Either closes the current log or creates and closes the initial log |
| 396 // (depending on |state_|), and stages it for upload. | 390 // (depending on |state_|), and stages it for upload. |
| 397 void StageNewLog(); | 391 void StageNewLog(); |
| 398 | 392 |
| 399 // Prepares the initial stability log, which is only logged when the previous | 393 // Prepares the initial stability log, which is only logged when the previous |
| 400 // run of Chrome crashed. This log contains any stability metrics left over | 394 // run of Chrome crashed. This log contains any stability metrics left over |
| 401 // from that previous run, and only these stability metrics. It uses the | 395 // from that previous run, and only these stability metrics. It uses the |
| 402 // system profile from the previous session. | 396 // system profile from the previous session. |
| (...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 548 // this factory are invalidated in ScheduleNextStateSave. | 542 // this factory are invalidated in ScheduleNextStateSave. |
| 549 base::WeakPtrFactory<MetricsService> state_saver_factory_; | 543 base::WeakPtrFactory<MetricsService> state_saver_factory_; |
| 550 | 544 |
| 551 // The scheduler for determining when uploads should happen. | 545 // The scheduler for determining when uploads should happen. |
| 552 scoped_ptr<MetricsReportingScheduler> scheduler_; | 546 scoped_ptr<MetricsReportingScheduler> scheduler_; |
| 553 | 547 |
| 554 // Indicates that an asynchronous reporting step is running. | 548 // Indicates that an asynchronous reporting step is running. |
| 555 // This is used only for debugging. | 549 // This is used only for debugging. |
| 556 bool waiting_for_asynchronous_reporting_step_; | 550 bool waiting_for_asynchronous_reporting_step_; |
| 557 | 551 |
| 558 // Number of async histogram fetch requests in progress. | |
| 559 int num_async_histogram_fetches_in_progress_; | |
| 560 | |
| 561 // Stores the time of the first call to |GetUptimes()|. | 552 // Stores the time of the first call to |GetUptimes()|. |
| 562 base::TimeTicks first_updated_time_; | 553 base::TimeTicks first_updated_time_; |
| 563 | 554 |
| 564 // Stores the time of the last call to |GetUptimes()|. | 555 // Stores the time of the last call to |GetUptimes()|. |
| 565 base::TimeTicks last_updated_time_; | 556 base::TimeTicks last_updated_time_; |
| 566 | 557 |
| 567 // Execution phase the browser is in. | 558 // Execution phase the browser is in. |
| 568 static ExecutionPhase execution_phase_; | 559 static ExecutionPhase execution_phase_; |
| 569 | 560 |
| 570 // Reduntant marker to check that we completed our shutdown, and set the | 561 // 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... |
| 620 | 611 |
| 621 // Registers/unregisters |observer| to receive MetricsLog notifications | 612 // Registers/unregisters |observer| to receive MetricsLog notifications |
| 622 // from metrics service. | 613 // from metrics service. |
| 623 static void AddMetricsServiceObserver(MetricsServiceObserver* observer); | 614 static void AddMetricsServiceObserver(MetricsServiceObserver* observer); |
| 624 static void RemoveMetricsServiceObserver(MetricsServiceObserver* observer); | 615 static void RemoveMetricsServiceObserver(MetricsServiceObserver* observer); |
| 625 | 616 |
| 626 DISALLOW_IMPLICIT_CONSTRUCTORS(MetricsServiceHelper); | 617 DISALLOW_IMPLICIT_CONSTRUCTORS(MetricsServiceHelper); |
| 627 }; | 618 }; |
| 628 | 619 |
| 629 #endif // CHROME_BROWSER_METRICS_METRICS_SERVICE_H_ | 620 #endif // CHROME_BROWSER_METRICS_METRICS_SERVICE_H_ |
| OLD | NEW |