OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 // A simple wrapper around invalidation::InvalidationClient that | 5 // A simple wrapper around invalidation::InvalidationClient that |
6 // handles all the startup/shutdown details and hookups. | 6 // handles all the startup/shutdown details and hookups. |
7 | 7 |
8 #ifndef CHROME_BROWSER_SYNC_NOTIFIER_CHROME_INVALIDATION_CLIENT_H_ | 8 #ifndef CHROME_BROWSER_SYNC_NOTIFIER_CHROME_INVALIDATION_CLIENT_H_ |
9 #define CHROME_BROWSER_SYNC_NOTIFIER_CHROME_INVALIDATION_CLIENT_H_ | 9 #define CHROME_BROWSER_SYNC_NOTIFIER_CHROME_INVALIDATION_CLIENT_H_ |
10 #pragma once | 10 #pragma once |
(...skipping 23 matching lines...) Expand all Loading... |
34 // properly notify invalidation_client_. | 34 // properly notify invalidation_client_. |
35 | 35 |
36 class ChromeInvalidationClient | 36 class ChromeInvalidationClient |
37 : public invalidation::InvalidationListener, | 37 : public invalidation::InvalidationListener, |
38 public StateWriter { | 38 public StateWriter { |
39 public: | 39 public: |
40 class Listener { | 40 class Listener { |
41 public: | 41 public: |
42 virtual ~Listener(); | 42 virtual ~Listener(); |
43 | 43 |
44 virtual void OnInvalidate(syncable::ModelType model_type, | 44 virtual void OnInvalidate(syncable::ModelType model_type) = 0; |
45 const std::string& payload) = 0; | |
46 | 45 |
47 virtual void OnInvalidateAll() = 0; | 46 virtual void OnInvalidateAll() = 0; |
48 }; | 47 }; |
49 | 48 |
50 ChromeInvalidationClient(); | 49 ChromeInvalidationClient(); |
51 | 50 |
52 // Calls Stop(). | 51 // Calls Stop(). |
53 virtual ~ChromeInvalidationClient(); | 52 virtual ~ChromeInvalidationClient(); |
54 | 53 |
55 // Does not take ownership of |listener| or |state_writer|. | 54 // Does not take ownership of |listener| or |state_writer|. |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
111 scoped_ptr<CacheInvalidationPacketHandler> | 110 scoped_ptr<CacheInvalidationPacketHandler> |
112 cache_invalidation_packet_handler_; | 111 cache_invalidation_packet_handler_; |
113 scoped_ptr<RegistrationManager> registration_manager_; | 112 scoped_ptr<RegistrationManager> registration_manager_; |
114 | 113 |
115 DISALLOW_COPY_AND_ASSIGN(ChromeInvalidationClient); | 114 DISALLOW_COPY_AND_ASSIGN(ChromeInvalidationClient); |
116 }; | 115 }; |
117 | 116 |
118 } // namespace sync_notifier | 117 } // namespace sync_notifier |
119 | 118 |
120 #endif // CHROME_BROWSER_SYNC_NOTIFIER_CHROME_INVALIDATION_CLIENT_H_ | 119 #endif // CHROME_BROWSER_SYNC_NOTIFIER_CHROME_INVALIDATION_CLIENT_H_ |
OLD | NEW |