OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 SYNC_NOTIFIER_CHROME_INVALIDATION_CLIENT_H_ | 8 #ifndef SYNC_NOTIFIER_CHROME_INVALIDATION_CLIENT_H_ |
9 #define SYNC_NOTIFIER_CHROME_INVALIDATION_CLIENT_H_ | 9 #define SYNC_NOTIFIER_CHROME_INVALIDATION_CLIENT_H_ |
10 | 10 |
| 11 #include <map> |
11 #include <string> | 12 #include <string> |
12 | 13 |
13 #include "base/basictypes.h" | 14 #include "base/basictypes.h" |
14 #include "base/compiler_specific.h" | 15 #include "base/compiler_specific.h" |
15 #include "base/memory/scoped_ptr.h" | 16 #include "base/memory/scoped_ptr.h" |
16 #include "base/memory/weak_ptr.h" | 17 #include "base/memory/weak_ptr.h" |
17 #include "base/threading/non_thread_safe.h" | 18 #include "base/threading/non_thread_safe.h" |
18 #include "google/cacheinvalidation/include/invalidation-listener.h" | 19 #include "google/cacheinvalidation/include/invalidation-listener.h" |
19 #include "jingle/notifier/listener/push_client_observer.h" | 20 #include "jingle/notifier/listener/push_client_observer.h" |
20 #include "sync/internal_api/public/util/weak_handle.h" | 21 #include "sync/internal_api/public/util/weak_handle.h" |
21 #include "sync/notifier/chrome_system_resources.h" | 22 #include "sync/notifier/chrome_system_resources.h" |
22 #include "sync/notifier/invalidation_state_tracker.h" | 23 #include "sync/notifier/invalidation_state_tracker.h" |
| 24 #include "sync/notifier/invalidation_util.h" |
23 #include "sync/notifier/notifications_disabled_reason.h" | 25 #include "sync/notifier/notifications_disabled_reason.h" |
24 #include "sync/notifier/object_id_payload_map.h" | |
25 #include "sync/notifier/state_writer.h" | 26 #include "sync/notifier/state_writer.h" |
26 | 27 |
27 namespace buzz { | 28 namespace buzz { |
28 class XmppTaskParentInterface; | 29 class XmppTaskParentInterface; |
29 } // namespace buzz | 30 } // namespace buzz |
30 | 31 |
31 namespace notifier { | 32 namespace notifier { |
32 class PushClient; | 33 class PushClient; |
33 } // namespace notifier | 34 } // namespace notifier |
34 | 35 |
35 namespace syncer { | 36 namespace syncer { |
36 | 37 |
37 class RegistrationManager; | 38 class RegistrationManager; |
38 | 39 |
| 40 typedef std::map<invalidation::ObjectId, |
| 41 std::string, |
| 42 ObjectIdLessThan> ObjectIdPayloadMap; |
| 43 |
39 // ChromeInvalidationClient is not thread-safe and lives on the sync | 44 // ChromeInvalidationClient is not thread-safe and lives on the sync |
40 // thread. | 45 // thread. |
41 class ChromeInvalidationClient | 46 class ChromeInvalidationClient |
42 : public invalidation::InvalidationListener, | 47 : public invalidation::InvalidationListener, |
43 public StateWriter, | 48 public StateWriter, |
44 public notifier::PushClientObserver, | 49 public notifier::PushClientObserver, |
45 public base::NonThreadSafe { | 50 public base::NonThreadSafe { |
46 public: | 51 public: |
47 class Listener { | 52 class Listener { |
48 public: | 53 public: |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
144 // NO_NOTIFICATION_ERROR meaning notifications are enabled). | 149 // NO_NOTIFICATION_ERROR meaning notifications are enabled). |
145 NotificationsDisabledReason ticl_state_; | 150 NotificationsDisabledReason ticl_state_; |
146 NotificationsDisabledReason push_client_state_; | 151 NotificationsDisabledReason push_client_state_; |
147 | 152 |
148 DISALLOW_COPY_AND_ASSIGN(ChromeInvalidationClient); | 153 DISALLOW_COPY_AND_ASSIGN(ChromeInvalidationClient); |
149 }; | 154 }; |
150 | 155 |
151 } // namespace syncer | 156 } // namespace syncer |
152 | 157 |
153 #endif // SYNC_NOTIFIER_CHROME_INVALIDATION_CLIENT_H_ | 158 #endif // SYNC_NOTIFIER_CHROME_INVALIDATION_CLIENT_H_ |
OLD | NEW |