[email protected] | 001bbfdc | 2014-07-17 19:28:46 | [diff] [blame] | 1 | // Copyright 2014 The Chromium Authors. All rights reserved. |
[email protected] | e39ebd7 | 2011-03-14 07:13:25 | [diff] [blame] | 2 | // Use of this source code is governed by a BSD-style license that can be |
3 | // found in the LICENSE file. | ||||
4 | |||||
knn | 062cdbb | 2015-06-26 18:18:42 | [diff] [blame] | 5 | #ifndef COMPONENTS_INVALIDATION_PUBLIC_INVALIDATION_HANDLER_H_ |
6 | #define COMPONENTS_INVALIDATION_PUBLIC_INVALIDATION_HANDLER_H_ | ||||
[email protected] | e39ebd7 | 2011-03-14 07:13:25 | [diff] [blame] | 7 | |
[email protected] | b8868be | 2014-07-10 23:26:38 | [diff] [blame] | 8 | #include <string> |
9 | |||||
knn | 062cdbb | 2015-06-26 18:18:42 | [diff] [blame] | 10 | #include "components/invalidation/public/invalidation_export.h" |
11 | #include "components/invalidation/public/invalidator_state.h" | ||||
[email protected] | e39ebd7 | 2011-03-14 07:13:25 | [diff] [blame] | 12 | |
[email protected] | 65f17355 | 2012-06-28 22:43:58 | [diff] [blame] | 13 | namespace syncer { |
[email protected] | e39ebd7 | 2011-03-14 07:13:25 | [diff] [blame] | 14 | |
[email protected] | a7b1639 | 2013-11-26 22:46:26 | [diff] [blame] | 15 | class ObjectIdInvalidationMap; |
16 | |||||
[email protected] | 001bbfdc | 2014-07-17 19:28:46 | [diff] [blame] | 17 | class INVALIDATION_EXPORT InvalidationHandler { |
[email protected] | e39ebd7 | 2011-03-14 07:13:25 | [diff] [blame] | 18 | public: |
[email protected] | b8868be | 2014-07-10 23:26:38 | [diff] [blame] | 19 | InvalidationHandler(); |
20 | |||||
[email protected] | 08a6f999 | 2012-09-07 19:19:16 | [diff] [blame] | 21 | // Called when the invalidator state changes. |
22 | virtual void OnInvalidatorStateChange(InvalidatorState state) = 0; | ||||
[email protected] | 2d3d1d1 | 2012-06-18 20:50:28 | [diff] [blame] | 23 | |
[email protected] | 08a6f999 | 2012-09-07 19:19:16 | [diff] [blame] | 24 | // Called when a invalidation is received. The per-id states are in |
25 | // |id_state_map| and the source is in |source|. Note that this may be | ||||
26 | // called regardless of the current invalidator state. | ||||
27 | virtual void OnIncomingInvalidation( | ||||
[email protected] | 0d0b59d | 2013-02-02 00:24:47 | [diff] [blame] | 28 | const ObjectIdInvalidationMap& invalidation_map) = 0; |
[email protected] | 870bcb3 | 2012-06-11 22:27:54 | [diff] [blame] | 29 | |
[email protected] | 9b0d66b | 2014-02-20 13:16:01 | [diff] [blame] | 30 | virtual std::string GetOwnerName() const = 0; |
31 | |||||
[email protected] | 870bcb3 | 2012-06-11 22:27:54 | [diff] [blame] | 32 | protected: |
[email protected] | b8868be | 2014-07-10 23:26:38 | [diff] [blame] | 33 | virtual ~InvalidationHandler(); |
[email protected] | e39ebd7 | 2011-03-14 07:13:25 | [diff] [blame] | 34 | }; |
[email protected] | 0a80fed | 2011-03-24 22:31:48 | [diff] [blame] | 35 | |
[email protected] | 65f17355 | 2012-06-28 22:43:58 | [diff] [blame] | 36 | } // namespace syncer |
[email protected] | 0a80fed | 2011-03-24 22:31:48 | [diff] [blame] | 37 | |
knn | 062cdbb | 2015-06-26 18:18:42 | [diff] [blame] | 38 | #endif // COMPONENTS_INVALIDATION_PUBLIC_INVALIDATION_HANDLER_H_ |