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