OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 COMPONENTS_INVALIDATION_INVALIDATION_SERVICE_ANDROID_H_ | 5 #ifndef COMPONENTS_INVALIDATION_INVALIDATION_SERVICE_ANDROID_H_ |
6 #define COMPONENTS_INVALIDATION_INVALIDATION_SERVICE_ANDROID_H_ | 6 #define COMPONENTS_INVALIDATION_INVALIDATION_SERVICE_ANDROID_H_ |
7 | 7 |
8 #include <jni.h> | 8 #include <jni.h> |
9 #include <map> | 9 #include <map> |
10 | 10 |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 const syncer::ObjectIdSet& ids) override; | 43 const syncer::ObjectIdSet& ids) override; |
44 void UnregisterInvalidationHandler( | 44 void UnregisterInvalidationHandler( |
45 syncer::InvalidationHandler* handler) override; | 45 syncer::InvalidationHandler* handler) override; |
46 syncer::InvalidatorState GetInvalidatorState() const override; | 46 syncer::InvalidatorState GetInvalidatorState() const override; |
47 std::string GetInvalidatorClientId() const override; | 47 std::string GetInvalidatorClientId() const override; |
48 InvalidationLogger* GetInvalidationLogger() override; | 48 InvalidationLogger* GetInvalidationLogger() override; |
49 void RequestDetailedStatus( | 49 void RequestDetailedStatus( |
50 base::Callback<void(const base::DictionaryValue&)> caller) const override; | 50 base::Callback<void(const base::DictionaryValue&)> caller) const override; |
51 IdentityProvider* GetIdentityProvider() override; | 51 IdentityProvider* GetIdentityProvider() override; |
52 | 52 |
53 void RequestSync(JNIEnv* env, | 53 void Invalidate(JNIEnv* env, |
54 jobject obj, | 54 jobject obj, |
55 jint object_source, | 55 jint object_source, |
56 jstring object_id, | 56 jstring object_id, |
57 jlong version, | 57 jlong version, |
58 jstring state); | 58 jstring state); |
59 | |
60 void RequestSyncForAllTypes(JNIEnv* env, jobject obj); | |
61 | 59 |
62 // The InvalidationServiceAndroid always reports that it is enabled. | 60 // The InvalidationServiceAndroid always reports that it is enabled. |
63 // This is used only by unit tests. | 61 // This is used only by unit tests. |
64 void TriggerStateChangeForTest(syncer::InvalidatorState state); | 62 void TriggerStateChangeForTest(syncer::InvalidatorState state); |
65 | 63 |
66 static bool RegisterJni(JNIEnv* env); | 64 static bool RegisterJni(JNIEnv* env); |
67 | 65 |
68 private: | 66 private: |
69 typedef std::map<invalidation::ObjectId, | 67 typedef std::map<invalidation::ObjectId, |
70 int64, | 68 int64, |
(...skipping 11 matching lines...) Expand all Loading... |
82 | 80 |
83 // The invalidation API spec allows for the possibility of redundant | 81 // The invalidation API spec allows for the possibility of redundant |
84 // invalidations, so keep track of the max versions and drop | 82 // invalidations, so keep track of the max versions and drop |
85 // invalidations with old versions. | 83 // invalidations with old versions. |
86 ObjectIdVersionMap max_invalidation_versions_; | 84 ObjectIdVersionMap max_invalidation_versions_; |
87 | 85 |
88 // The invalidation logger object we use to record state changes | 86 // The invalidation logger object we use to record state changes |
89 // and invalidations. | 87 // and invalidations. |
90 InvalidationLogger logger_; | 88 InvalidationLogger logger_; |
91 | 89 |
92 void DispatchInvalidations( | |
93 syncer::ObjectIdInvalidationMap& object_invalidation_map); | |
94 | |
95 DISALLOW_COPY_AND_ASSIGN(InvalidationServiceAndroid); | 90 DISALLOW_COPY_AND_ASSIGN(InvalidationServiceAndroid); |
96 }; | 91 }; |
97 | 92 |
98 } // namespace invalidation | 93 } // namespace invalidation |
99 | 94 |
100 #endif // COMPONENTS_INVALIDATION_INVALIDATION_SERVICE_ANDROID_H_ | 95 #endif // COMPONENTS_INVALIDATION_INVALIDATION_SERVICE_ANDROID_H_ |
OLD | NEW |