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

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

Issue 2517363002: Decouple Metrics Initialization from IO Thread Initialization (Closed)
Patch Set: Fix Unit Test 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
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 prefs according to what the PrefService expects.
210 // from any thread, but this function should be called on UI thread. 210 void UpdateMetricsUsagePrefs(
211 UpdateUsagePrefCallbackType GetDataUseForwardingCallback(); 211 const std::string& service_name, int message_size, bool is_cellular);
212 212
213 // Merge any data from metrics providers into the global StatisticsRecorder. 213 // Merge any data from metrics providers into the global StatisticsRecorder.
214 void MergeHistogramDeltas(); 214 void MergeHistogramDeltas();
215 215
216 protected: 216 protected:
217 // Exposed for testing. 217 // Exposed for testing.
218 MetricsLogManager* log_manager() { return &log_manager_; } 218 MetricsLogManager* log_manager() { return &log_manager_; }
219 219
220 private: 220 private:
221 friend class MetricsServiceAccessor; 221 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 495 // Weak pointers factory used for saving state. All weak pointers managed by
496 // this factory are invalidated in ScheduleNextStateSave. 496 // this factory are invalidated in ScheduleNextStateSave.
497 base::WeakPtrFactory<MetricsService> state_saver_factory_; 497 base::WeakPtrFactory<MetricsService> state_saver_factory_;
498 498
499 DISALLOW_COPY_AND_ASSIGN(MetricsService); 499 DISALLOW_COPY_AND_ASSIGN(MetricsService);
500 }; 500 };
501 501
502 } // namespace metrics 502 } // namespace metrics
503 503
504 #endif // COMPONENTS_METRICS_METRICS_SERVICE_H_ 504 #endif // COMPONENTS_METRICS_METRICS_SERVICE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698