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