| 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_IMPL_INVALIDATION_SERVICE_ANDROID_H_ | 5 #ifndef COMPONENTS_INVALIDATION_IMPL_INVALIDATION_SERVICE_ANDROID_H_ |
| 6 #define COMPONENTS_INVALIDATION_IMPL_INVALIDATION_SERVICE_ANDROID_H_ | 6 #define COMPONENTS_INVALIDATION_IMPL_INVALIDATION_SERVICE_ANDROID_H_ |
| 7 | 7 |
| 8 #include <jni.h> | 8 #include <jni.h> |
| 9 #include <stdint.h> | 9 #include <stdint.h> |
| 10 | 10 |
| 11 #include <map> | 11 #include <map> |
| 12 | 12 |
| 13 #include "base/android/jni_android.h" | 13 #include "base/android/jni_android.h" |
| 14 #include "base/android/scoped_java_ref.h" | 14 #include "base/android/scoped_java_ref.h" |
| 15 #include "base/compiler_specific.h" | 15 #include "base/compiler_specific.h" |
| 16 #include "base/macros.h" | 16 #include "base/macros.h" |
| 17 #include "base/threading/non_thread_safe.h" | 17 #include "base/sequence_checker.h" |
| 18 #include "components/invalidation/impl/invalidation_logger.h" | 18 #include "components/invalidation/impl/invalidation_logger.h" |
| 19 #include "components/invalidation/impl/invalidator_registrar.h" | 19 #include "components/invalidation/impl/invalidator_registrar.h" |
| 20 #include "components/invalidation/public/invalidation_service.h" | 20 #include "components/invalidation/public/invalidation_service.h" |
| 21 #include "components/keyed_service/core/keyed_service.h" | 21 #include "components/keyed_service/core/keyed_service.h" |
| 22 | 22 |
| 23 namespace invalidation { | 23 namespace invalidation { |
| 24 | 24 |
| 25 class InvalidationLogger; | 25 class InvalidationLogger; |
| 26 | 26 |
| 27 // This InvalidationService is used to deliver invalidations on Android. The | 27 // This InvalidationService is used to deliver invalidations on Android. The |
| 28 // Android operating system has its own mechanisms for delivering invalidations. | 28 // Android operating system has its own mechanisms for delivering invalidations. |
| 29 class InvalidationServiceAndroid | 29 class InvalidationServiceAndroid : public InvalidationService { |
| 30 : public base::NonThreadSafe, | |
| 31 public InvalidationService { | |
| 32 public: | 30 public: |
| 33 explicit InvalidationServiceAndroid(); | 31 explicit InvalidationServiceAndroid(); |
| 34 ~InvalidationServiceAndroid() override; | 32 ~InvalidationServiceAndroid() override; |
| 35 | 33 |
| 36 // InvalidationService implementation. | 34 // InvalidationService implementation. |
| 37 // | 35 // |
| 38 // Note that this implementation does not properly support Ack-tracking, | 36 // Note that this implementation does not properly support Ack-tracking, |
| 39 // fetching the invalidator state, or querying the client's ID. Support for | 37 // fetching the invalidator state, or querying the client's ID. Support for |
| 40 // exposing the client ID should be available soon; see crbug.com/172391. | 38 // exposing the client ID should be available soon; see crbug.com/172391. |
| 41 void RegisterInvalidationHandler( | 39 void RegisterInvalidationHandler( |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 80 | 78 |
| 81 // The invalidation API spec allows for the possibility of redundant | 79 // The invalidation API spec allows for the possibility of redundant |
| 82 // invalidations, so keep track of the max versions and drop | 80 // invalidations, so keep track of the max versions and drop |
| 83 // invalidations with old versions. | 81 // invalidations with old versions. |
| 84 ObjectIdVersionMap max_invalidation_versions_; | 82 ObjectIdVersionMap max_invalidation_versions_; |
| 85 | 83 |
| 86 // The invalidation logger object we use to record state changes | 84 // The invalidation logger object we use to record state changes |
| 87 // and invalidations. | 85 // and invalidations. |
| 88 InvalidationLogger logger_; | 86 InvalidationLogger logger_; |
| 89 | 87 |
| 88 SEQUENCE_CHECKER(sequence_checker_); |
| 89 |
| 90 DISALLOW_COPY_AND_ASSIGN(InvalidationServiceAndroid); | 90 DISALLOW_COPY_AND_ASSIGN(InvalidationServiceAndroid); |
| 91 }; | 91 }; |
| 92 | 92 |
| 93 } // namespace invalidation | 93 } // namespace invalidation |
| 94 | 94 |
| 95 #endif // COMPONENTS_INVALIDATION_IMPL_INVALIDATION_SERVICE_ANDROID_H_ | 95 #endif // COMPONENTS_INVALIDATION_IMPL_INVALIDATION_SERVICE_ANDROID_H_ |
| OLD | NEW |