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

Side by Side Diff: components/metrics/metrics_service.h

Issue 993813002: Refactor metrics callback functions (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@states
Patch Set: Created 5 years, 9 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
« no previous file with comments | « no previous file | components/metrics/metrics_service.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 311 matching lines...) Expand 10 before | Expand all | Expand 10 after
322 // Called when Chrome shuts down. 322 // Called when Chrome shuts down.
323 void PushPendingLogsToPersistentStorage(); 323 void PushPendingLogsToPersistentStorage();
324 324
325 // Ensures that scheduler is running, assuming the current settings are such 325 // Ensures that scheduler is running, assuming the current settings are such
326 // that metrics should be reported. If not, this is a no-op. 326 // that metrics should be reported. If not, this is a no-op.
327 void StartSchedulerIfNecessary(); 327 void StartSchedulerIfNecessary();
328 328
329 // Starts the process of uploading metrics data. 329 // Starts the process of uploading metrics data.
330 void StartScheduledUpload(); 330 void StartScheduledUpload();
331 331
332 // Called by the client when final log info collection is complete. 332 // Called by the client via a callback when final log info collection is
333 // complete.
333 void OnFinalLogInfoCollectionDone(); 334 void OnFinalLogInfoCollectionDone();
334 335
335 // Either closes the current log or creates and closes the initial log 336 // If recording is enabled, begins uploading the next completed log from
336 // (depending on |state_|), and stages it for upload. 337 // the log manager, staging it if necessary.
337 void StageNewLog(); 338 void SendNextLog();
338 339
339 // Returns true if any of the registered metrics providers have stability 340 // Returns true if any of the registered metrics providers have stability
340 // metrics to report. 341 // metrics to report.
341 bool ProvidersHaveStabilityMetrics(); 342 bool ProvidersHaveStabilityMetrics();
342 343
343 // Prepares the initial stability log, which is only logged when the previous 344 // Prepares the initial stability log, which is only logged when the previous
344 // run of Chrome crashed. This log contains any stability metrics left over 345 // run of Chrome crashed. This log contains any stability metrics left over
345 // from that previous run, and only these stability metrics. It uses the 346 // from that previous run, and only these stability metrics. It uses the
346 // system profile from the previous session. Returns true if a log was 347 // system profile from the previous session. Returns true if a log was
347 // created. 348 // created.
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after
488 // Weak pointers factory used for saving state. All weak pointers managed by 489 // Weak pointers factory used for saving state. All weak pointers managed by
489 // this factory are invalidated in ScheduleNextStateSave. 490 // this factory are invalidated in ScheduleNextStateSave.
490 base::WeakPtrFactory<MetricsService> state_saver_factory_; 491 base::WeakPtrFactory<MetricsService> state_saver_factory_;
491 492
492 DISALLOW_COPY_AND_ASSIGN(MetricsService); 493 DISALLOW_COPY_AND_ASSIGN(MetricsService);
493 }; 494 };
494 495
495 } // namespace metrics 496 } // namespace metrics
496 497
497 #endif // COMPONENTS_METRICS_METRICS_SERVICE_H_ 498 #endif // COMPONENTS_METRICS_METRICS_SERVICE_H_
OLDNEW
« no previous file with comments | « no previous file | components/metrics/metrics_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698