| 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 #pragma once | 10 #pragma once |
| (...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 212 // Called when Chrome shuts down. | 212 // Called when Chrome shuts down. |
| 213 void PushPendingLogsToPersistentStorage(); | 213 void PushPendingLogsToPersistentStorage(); |
| 214 | 214 |
| 215 // Ensures that scheduler is running, assuming the current settings are such | 215 // Ensures that scheduler is running, assuming the current settings are such |
| 216 // that metrics should be reported. If not, this is a no-op. | 216 // that metrics should be reported. If not, this is a no-op. |
| 217 void StartSchedulerIfNecessary(); | 217 void StartSchedulerIfNecessary(); |
| 218 | 218 |
| 219 // Starts the process of uploading metrics data. | 219 // Starts the process of uploading metrics data. |
| 220 void StartScheduledUpload(); | 220 void StartScheduledUpload(); |
| 221 | 221 |
| 222 // Do not call OnMemoryDetailCollectionDone() or | 222 // Starts collecting any data that should be added to a log just before it is |
| 223 // OnHistogramSynchronizationDone() directly; use | 223 // closed. |
| 224 // StartSchedulerIfNecessary() to schedule a call. | 224 void StartFinalLogInfoCollection(); |
| 225 // Callbacks for various stages of final log info collection. Do not call |
| 226 // these directly. |
| 225 void OnMemoryDetailCollectionDone(); | 227 void OnMemoryDetailCollectionDone(); |
| 226 void OnHistogramSynchronizationDone(); | 228 void OnHistogramSynchronizationDone(); |
| 229 void OnFinalLogInfoCollectionDone(); |
| 227 | 230 |
| 228 // Takes whatever log should be uploaded next (according to the state_) | 231 // Takes whatever log should be uploaded next (according to the state_) |
| 229 // and makes it the staged log. If there is already a staged log, this is a | 232 // and makes it the staged log. If there is already a staged log, this is a |
| 230 // no-op. | 233 // no-op. |
| 231 void MakeStagedLog(); | 234 void MakeStagedLog(); |
| 232 | 235 |
| 233 // Record stats, client ID, Session ID, etc. in a special "first" log. | 236 // Record stats, client ID, Session ID, etc. in a special "first" log. |
| 234 void PrepareInitialLog(); | 237 void PrepareInitialLog(); |
| 235 | 238 |
| 239 // Uploads the currently staged log (which must be non-null). |
| 240 void SendStagedLog(); |
| 241 |
| 236 // Prepared the staged log to be passed to the server. Upon return, | 242 // Prepared the staged log to be passed to the server. Upon return, |
| 237 // current_fetch_ should be reset with its upload data set to a compressed | 243 // current_fetch_ should be reset with its upload data set to a compressed |
| 238 // copy of the staged log. | 244 // copy of the staged log. |
| 239 void PrepareFetchWithStagedLog(); | 245 void PrepareFetchWithStagedLog(); |
| 240 | 246 |
| 241 // Implementation of content::URLFetcherDelegate. Called after transmission | 247 // Implementation of content::URLFetcherDelegate. Called after transmission |
| 242 // completes (either successfully or with failure). | 248 // completes (either successfully or with failure). |
| 243 virtual void OnURLFetchComplete(const content::URLFetcher* source) OVERRIDE; | 249 virtual void OnURLFetchComplete(const content::URLFetcher* source) OVERRIDE; |
| 244 | 250 |
| 245 // Logs debugging details, for the case where the server returns a response | 251 // Logs debugging details, for the case where the server returns a response |
| (...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 425 friend class InstantFieldTrial; | 431 friend class InstantFieldTrial; |
| 426 friend bool prerender::IsOmniboxEnabled(Profile* profile); | 432 friend bool prerender::IsOmniboxEnabled(Profile* profile); |
| 427 | 433 |
| 428 // Returns true if prefs::kMetricsReportingEnabled is set. | 434 // Returns true if prefs::kMetricsReportingEnabled is set. |
| 429 static bool IsMetricsReportingEnabled(); | 435 static bool IsMetricsReportingEnabled(); |
| 430 | 436 |
| 431 DISALLOW_IMPLICIT_CONSTRUCTORS(MetricsServiceHelper); | 437 DISALLOW_IMPLICIT_CONSTRUCTORS(MetricsServiceHelper); |
| 432 }; | 438 }; |
| 433 | 439 |
| 434 #endif // CHROME_BROWSER_METRICS_METRICS_SERVICE_H_ | 440 #endif // CHROME_BROWSER_METRICS_METRICS_SERVICE_H_ |
| OLD | NEW |