| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 CHROME_BROWSER_SYNC_PROFILE_SYNC_SERVICE_ANDROID_H_ | 5 #ifndef CHROME_BROWSER_SYNC_PROFILE_SYNC_SERVICE_ANDROID_H_ |
| 6 #define CHROME_BROWSER_SYNC_PROFILE_SYNC_SERVICE_ANDROID_H_ | 6 #define CHROME_BROWSER_SYNC_PROFILE_SYNC_SERVICE_ANDROID_H_ |
| 7 | 7 |
| 8 #include <jni.h> | 8 #include <jni.h> |
| 9 #include <map> | 9 #include <map> |
| 10 | 10 |
| (...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 197 // Returns a timestamp for when a sync was last executed. The return value is | 197 // Returns a timestamp for when a sync was last executed. The return value is |
| 198 // the internal value of base::Time. | 198 // the internal value of base::Time. |
| 199 jlong GetLastSyncedTimeForTest(JNIEnv* env, jobject obj); | 199 jlong GetLastSyncedTimeForTest(JNIEnv* env, jobject obj); |
| 200 | 200 |
| 201 // Overrides ProfileSyncService's NetworkResources object. This is used to | 201 // Overrides ProfileSyncService's NetworkResources object. This is used to |
| 202 // set up the Sync FakeServer for testing. | 202 // set up the Sync FakeServer for testing. |
| 203 void OverrideNetworkResourcesForTest(JNIEnv* env, | 203 void OverrideNetworkResourcesForTest(JNIEnv* env, |
| 204 jobject obj, | 204 jobject obj, |
| 205 jlong network_resources); | 205 jlong network_resources); |
| 206 | 206 |
| 207 // Public for tests. |
| 208 static jlong ModelTypeSetToSelection(syncer::ModelTypeSet model_types); |
| 209 |
| 210 // Converts a bitmap of model types to a set of Java ModelTypes, and returns |
| 211 // their string descriptions separated by commas. |
| 212 static std::string ModelTypeSelectionToStringForTest( |
| 213 jlong model_type_selection); |
| 214 |
| 207 static ProfileSyncServiceAndroid* GetProfileSyncServiceAndroid(); | 215 static ProfileSyncServiceAndroid* GetProfileSyncServiceAndroid(); |
| 208 | 216 |
| 209 // Registers the ProfileSyncServiceAndroid's native methods through JNI. | 217 // Registers the ProfileSyncServiceAndroid's native methods through JNI. |
| 210 static bool Register(JNIEnv* env); | 218 static bool Register(JNIEnv* env); |
| 211 | 219 |
| 212 private: | 220 private: |
| 213 typedef std::map<invalidation::ObjectId, | 221 typedef std::map<invalidation::ObjectId, |
| 214 int64, | 222 int64, |
| 215 syncer::ObjectIdLessThan> ObjectIdVersionMap; | 223 syncer::ObjectIdLessThan> ObjectIdVersionMap; |
| 216 | 224 |
| (...skipping 19 matching lines...) Expand all Loading... |
| 236 | 244 |
| 237 // The invalidation API spec allows for the possibility of redundant | 245 // The invalidation API spec allows for the possibility of redundant |
| 238 // invalidations, so keep track of the max versions and drop | 246 // invalidations, so keep track of the max versions and drop |
| 239 // invalidations with old versions. | 247 // invalidations with old versions. |
| 240 ObjectIdVersionMap max_invalidation_versions_; | 248 ObjectIdVersionMap max_invalidation_versions_; |
| 241 | 249 |
| 242 DISALLOW_COPY_AND_ASSIGN(ProfileSyncServiceAndroid); | 250 DISALLOW_COPY_AND_ASSIGN(ProfileSyncServiceAndroid); |
| 243 }; | 251 }; |
| 244 | 252 |
| 245 #endif // CHROME_BROWSER_SYNC_PROFILE_SYNC_SERVICE_ANDROID_H_ | 253 #endif // CHROME_BROWSER_SYNC_PROFILE_SYNC_SERVICE_ANDROID_H_ |
| OLD | NEW |