Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(92)

Side by Side Diff: chrome/browser/metrics/metrics_service.h

Issue 9396001: Begin to separate the MetricsService logic for creating vs uploading logs (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 200 matching lines...) Expand 10 before | Expand all | Expand 10 after
211 // Called when Chrome shuts down. 211 // Called when Chrome shuts down.
212 void PushPendingLogsToPersistentStorage(); 212 void PushPendingLogsToPersistentStorage();
213 213
214 // Ensures that scheduler is running, assuming the current settings are such 214 // Ensures that scheduler is running, assuming the current settings are such
215 // that metrics should be reported. If not, this is a no-op. 215 // that metrics should be reported. If not, this is a no-op.
216 void StartSchedulerIfNecessary(); 216 void StartSchedulerIfNecessary();
217 217
218 // Starts the process of uploading metrics data. 218 // Starts the process of uploading metrics data.
219 void StartScheduledUpload(); 219 void StartScheduledUpload();
220 220
221 // Do not call OnMemoryDetailCollectionDone() or 221 // Starts collecting any data that should be added to a log just before it is
222 // OnHistogramSynchronizationDone() directly; use 222 // closed.
223 // StartSchedulerIfNecessary() to schedule a call. 223 void StartFinalLogInfoCollection();
224 // Callbacks for various stages of final log info collection. Do not call
225 // these directly.
224 void OnMemoryDetailCollectionDone(); 226 void OnMemoryDetailCollectionDone();
225 void OnHistogramSynchronizationDone(); 227 void OnHistogramSynchronizationDone();
228 void OnFinalLogInfoCollectionDone();
226 229
227 // Takes whatever log should be uploaded next (according to the state_) 230 // Takes whatever log should be uploaded next (according to the state_)
228 // and makes it the staged log. If there is already a staged log, this is a 231 // and makes it the staged log. If there is already a staged log, this is a
229 // no-op. 232 // no-op.
230 void MakeStagedLog(); 233 void MakeStagedLog();
231 234
232 // Record stats, client ID, Session ID, etc. in a special "first" log. 235 // Record stats, client ID, Session ID, etc. in a special "first" log.
233 void PrepareInitialLog(); 236 void PrepareInitialLog();
234 237
238 // Uploads the currently staged log (which must be non-null).
239 void SendStagedLog();
240
235 // Prepared the staged log to be passed to the server. Upon return, 241 // Prepared the staged log to be passed to the server. Upon return,
236 // current_fetch_ should be reset with its upload data set to a compressed 242 // current_fetch_ should be reset with its upload data set to a compressed
237 // copy of the staged log. 243 // copy of the staged log.
238 void PrepareFetchWithStagedLog(); 244 void PrepareFetchWithStagedLog();
239 245
240 // Implementation of content::URLFetcherDelegate. Called after transmission 246 // Implementation of content::URLFetcherDelegate. Called after transmission
241 // completes (either successfully or with failure). 247 // completes (either successfully or with failure).
242 virtual void OnURLFetchComplete(const content::URLFetcher* source) OVERRIDE; 248 virtual void OnURLFetchComplete(const content::URLFetcher* source) OVERRIDE;
243 249
244 // Logs debugging details, for the case where the server returns a response 250 // Logs debugging details, for the case where the server returns a response
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after
411 friend class InstantFieldTrial; 417 friend class InstantFieldTrial;
412 friend bool prerender::IsOmniboxEnabled(Profile* profile); 418 friend bool prerender::IsOmniboxEnabled(Profile* profile);
413 419
414 // Returns true if prefs::kMetricsReportingEnabled is set. 420 // Returns true if prefs::kMetricsReportingEnabled is set.
415 static bool IsMetricsReportingEnabled(); 421 static bool IsMetricsReportingEnabled();
416 422
417 DISALLOW_IMPLICIT_CONSTRUCTORS(MetricsServiceHelper); 423 DISALLOW_IMPLICIT_CONSTRUCTORS(MetricsServiceHelper);
418 }; 424 };
419 425
420 #endif // CHROME_BROWSER_METRICS_METRICS_SERVICE_H_ 426 #endif // CHROME_BROWSER_METRICS_METRICS_SERVICE_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/metrics/metrics_service.cc » ('j') | chrome/common/metrics/metrics_log_manager.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698