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

Side by Side Diff: components/ukm/ukm_service.h

Issue 2722113004: Flush UKM metrics when backgrounded on Android and iOS. (Closed)
Patch Set: address comment Created 3 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 | « chrome/browser/android/metrics/uma_session_stats.cc ('k') | components/ukm/ukm_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 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 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 #ifndef COMPONENTS_UKM_UKM_SERVICE_H_ 5 #ifndef COMPONENTS_UKM_UKM_SERVICE_H_
6 #define COMPONENTS_UKM_UKM_SERVICE_H_ 6 #define COMPONENTS_UKM_UKM_SERVICE_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 #include <memory> 9 #include <memory>
10 #include <vector> 10 #include <vector>
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 58
59 // Enables/disables recording control if data is allowed to be collected. 59 // Enables/disables recording control if data is allowed to be collected.
60 void EnableRecording(); 60 void EnableRecording();
61 void DisableRecording(); 61 void DisableRecording();
62 62
63 // Enables/disables transmission of accumulated logs. Logs that have already 63 // Enables/disables transmission of accumulated logs. Logs that have already
64 // been created will remain persisted to disk. 64 // been created will remain persisted to disk.
65 void EnableReporting(); 65 void EnableReporting();
66 void DisableReporting(); 66 void DisableReporting();
67 67
68 #if defined(OS_ANDROID) || defined(OS_IOS)
69 void OnAppEnterBackground();
70 void OnAppEnterForeground();
71 #endif
72
68 // Records any collected data into logs, and writes to disk. 73 // Records any collected data into logs, and writes to disk.
69 void Flush(); 74 void Flush();
70 75
71 // Deletes any unsent local data. 76 // Deletes any unsent local data.
72 void Purge(); 77 void Purge();
73 78
74 // Resets the client id stored in prefs. 79 // Resets the client id stored in prefs.
75 void ResetClientId(); 80 void ResetClientId();
76 81
77 // Registers the specified |provider| to provide additional metrics into the 82 // Registers the specified |provider| to provide additional metrics into the
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
176 // Weak pointers factory used to post task on different threads. All weak 181 // Weak pointers factory used to post task on different threads. All weak
177 // pointers managed by this factory have the same lifetime as UkmService. 182 // pointers managed by this factory have the same lifetime as UkmService.
178 base::WeakPtrFactory<UkmService> self_ptr_factory_; 183 base::WeakPtrFactory<UkmService> self_ptr_factory_;
179 184
180 DISALLOW_COPY_AND_ASSIGN(UkmService); 185 DISALLOW_COPY_AND_ASSIGN(UkmService);
181 }; 186 };
182 187
183 } // namespace ukm 188 } // namespace ukm
184 189
185 #endif // COMPONENTS_UKM_UKM_SERVICE_H_ 190 #endif // COMPONENTS_UKM_UKM_SERVICE_H_
OLDNEW
« no previous file with comments | « chrome/browser/android/metrics/uma_session_stats.cc ('k') | components/ukm/ukm_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698