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

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

Issue 2517363002: Decouple Metrics Initialization from IO Thread Initialization (Closed)
Patch Set: CR Feedback Created 4 years 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 | « components/metrics/data_use_tracker_unittest.cc ('k') | 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 188 matching lines...) Expand 10 before | Expand all | Expand 10 after
199 // should not be called more than once. 199 // should not be called more than once.
200 void CheckForClonedInstall( 200 void CheckForClonedInstall(
201 scoped_refptr<base::SingleThreadTaskRunner> task_runner); 201 scoped_refptr<base::SingleThreadTaskRunner> task_runner);
202 202
203 // Clears the stability metrics that are saved in local state. 203 // Clears the stability metrics that are saved in local state.
204 void ClearSavedStabilityMetrics(); 204 void ClearSavedStabilityMetrics();
205 205
206 // Pushes a log that has been generated by an external component. 206 // Pushes a log that has been generated by an external component.
207 void PushExternalLog(const std::string& log); 207 void PushExternalLog(const std::string& log);
208 208
209 // Returns a callback to data use pref updating function which can be called 209 // Updates data usage tracking prefs with the specified values.
210 // from any thread, but this function should be called on UI thread. 210 void UpdateMetricsUsagePrefs(const std::string& service_name,
211 UpdateUsagePrefCallbackType GetDataUseForwardingCallback(); 211 int message_size,
212 bool is_cellular);
212 213
213 // Merge any data from metrics providers into the global StatisticsRecorder. 214 // Merge any data from metrics providers into the global StatisticsRecorder.
214 void MergeHistogramDeltas(); 215 void MergeHistogramDeltas();
215 216
216 protected: 217 protected:
217 // Exposed for testing. 218 // Exposed for testing.
218 MetricsLogManager* log_manager() { return &log_manager_; } 219 MetricsLogManager* log_manager() { return &log_manager_; }
219 220
220 private: 221 private:
221 friend class MetricsServiceAccessor; 222 friend class MetricsServiceAccessor;
(...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after
495 // Weak pointers factory used for saving state. All weak pointers managed by 496 // Weak pointers factory used for saving state. All weak pointers managed by
496 // this factory are invalidated in ScheduleNextStateSave. 497 // this factory are invalidated in ScheduleNextStateSave.
497 base::WeakPtrFactory<MetricsService> state_saver_factory_; 498 base::WeakPtrFactory<MetricsService> state_saver_factory_;
498 499
499 DISALLOW_COPY_AND_ASSIGN(MetricsService); 500 DISALLOW_COPY_AND_ASSIGN(MetricsService);
500 }; 501 };
501 502
502 } // namespace metrics 503 } // namespace metrics
503 504
504 #endif // COMPONENTS_METRICS_METRICS_SERVICE_H_ 505 #endif // COMPONENTS_METRICS_METRICS_SERVICE_H_
OLDNEW
« no previous file with comments | « components/metrics/data_use_tracker_unittest.cc ('k') | components/metrics/metrics_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698