| Index: chrome/browser/sync/notifier/cache_invalidation_packet_handler.h
|
| ===================================================================
|
| --- chrome/browser/sync/notifier/cache_invalidation_packet_handler.h (revision 119260)
|
| +++ chrome/browser/sync/notifier/cache_invalidation_packet_handler.h (working copy)
|
| @@ -17,6 +17,8 @@
|
| #include "base/memory/weak_ptr.h"
|
| #include "base/threading/non_thread_safe.h"
|
| #include "google/cacheinvalidation/v2/system-resources.h"
|
| +#include "jingle/notifier/listener/push_notifications_listen_task.h"
|
| +#include "jingle/notifier/listener/push_notifications_subscribe_task.h"
|
|
|
| namespace buzz {
|
| class XmppTaskParentInterface;
|
| @@ -24,7 +26,9 @@
|
|
|
| namespace sync_notifier {
|
|
|
| -class CacheInvalidationPacketHandler {
|
| +class CacheInvalidationPacketHandler
|
| + : public notifier::PushNotificationsSubscribeTaskDelegate,
|
| + public notifier::PushNotificationsListenTaskDelegate {
|
| public:
|
| // Starts routing packets from |invalidation_client| using
|
| // |base_task|. |base_task.get()| must still be non-NULL.
|
| @@ -44,12 +48,20 @@
|
| virtual void SetMessageReceiver(
|
| invalidation::MessageCallback* incoming_receiver);
|
|
|
| + // Sends a message requesting a subscription to the notification channel.
|
| + virtual void SendSubscriptionRequest();
|
| +
|
| + // PushNotificationsSubscribeTaskDelegate implementation.
|
| + virtual void OnSubscribed() OVERRIDE;
|
| + virtual void OnSubscriptionError() OVERRIDE;
|
| +
|
| + // PushNotificationsListenTaskDelegate implementation.
|
| + virtual void OnNotificationReceived(
|
| + const notifier::Notification& notification) OVERRIDE;
|
| +
|
| private:
|
| FRIEND_TEST_ALL_PREFIXES(CacheInvalidationPacketHandlerTest, Basic);
|
|
|
| - void HandleInboundPacket(const std::string& packet);
|
| - void HandleChannelContextChange(const std::string& context);
|
| -
|
| base::NonThreadSafe non_thread_safe_;
|
| base::WeakPtrFactory<CacheInvalidationPacketHandler> weak_factory_;
|
|
|
| @@ -61,10 +73,10 @@
|
|
|
| // Monotonically increasing sequence number.
|
| int seq_;
|
| - // Unique session token.
|
| - const std::string sid_;
|
| - // Channel context.
|
| - std::string channel_context_;
|
| + // Service context.
|
| + std::string service_context_;
|
| + // Scheduling hash.
|
| + int64 scheduling_hash_;
|
|
|
| DISALLOW_COPY_AND_ASSIGN(CacheInvalidationPacketHandler);
|
| };
|
|
|