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

Unified Diff: components/ukm/ukm_service.h

Issue 2649303004: UKM: Added support for navigation sources (Closed)
Patch Set: Removed redundant test steps Created 3 years, 11 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 side-by-side diff with in-line comments
Download patch
Index: components/ukm/ukm_service.h
diff --git a/components/ukm/ukm_service.h b/components/ukm/ukm_service.h
index 9ffd417d54bbc5b6ae8ba505987118ae25679bec..bcb223d7ace2eadd972b976cadfa9f2ae5650eeb 100644
--- a/components/ukm/ukm_service.h
+++ b/components/ukm/ukm_service.h
@@ -26,6 +26,8 @@ class MetricsServiceClient;
namespace ukm {
+class UkmSource;
+
// This feature controls whether UkmService should be created.
extern const base::Feature kUkmFeature;
@@ -48,6 +50,8 @@ class UkmService : public base::SupportsWeakPtr<UkmService> {
void EnableReporting();
void DisableReporting();
+ void RecordSource(std::unique_ptr<UkmSource> source);
Alexei Svitkine (slow) 2017/01/25 15:35:04 Add a comment about what this does. Mention the li
oystein (OOO til 10th of July) 2017/01/25 18:38:04 Done.
Alexei Svitkine (slow) 2017/01/25 18:40:44 Not done? I don't see the change.
+
// Record any collected data into logs, and write to disk.
void Flush();
@@ -58,6 +62,11 @@ class UkmService : public base::SupportsWeakPtr<UkmService> {
// the provided PrefRegistry.
static void RegisterPrefs(PrefRegistrySimple* registry);
+ protected:
+ const std::vector<std::unique_ptr<UkmSource>>& sources_for_testing() const {
+ return sources_;
+ }
+
private:
// Start metrics client initialization.
void StartInitTask();
@@ -104,6 +113,8 @@ class UkmService : public base::SupportsWeakPtr<UkmService> {
bool initialize_complete_;
bool log_upload_in_progress_;
+ std::vector<std::unique_ptr<UkmSource>> sources_;
+
// Weak pointers factory used to post task on different threads. All weak
// pointers managed by this factory have the same lifetime as UkmService.
base::WeakPtrFactory<UkmService> self_ptr_factory_;

Powered by Google App Engine
This is Rietveld 408576698