| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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_ |
| OLD | NEW |