Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(5405)

Unified Diff: chrome/browser/sync/notifier/cache_invalidation_packet_handler.h

Issue 9190029: use push messaging in cache invalidation xmpp channel (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: Created 8 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/sync/notifier/cache_invalidation_packet_handler.h
===================================================================
--- chrome/browser/sync/notifier/cache_invalidation_packet_handler.h (revision 117278)
+++ 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::PushNotificationsListenTaskDelegate,
+ public notifier::PushNotificationsSubscribeTaskDelegate {
public:
// Starts routing packets from |invalidation_client| using
// |base_task|. |base_task.get()| must still be non-NULL.
@@ -44,12 +48,22 @@
virtual void SetMessageReceiver(
invalidation::MessageCallback* incoming_receiver);
akalin 2012/01/12 23:06:44 The Chrome style is: // FooInterface implementati
ghc 2012/01/13 01:23:07 Done.
+ // Sends a message requesting a subscription to the notification channel.
+ virtual void SendSubscriptionRequest();
+
+ // Called by subscription task to indicate subscription succeeded.
+ virtual void OnSubscribed();
+
+ // Called by subscription task to indicate subscription failed.
+ virtual void OnSubscriptionError();
+
+ // Handles an inbound notification.
+ virtual void OnNotificationReceived(
+ const notifier::Notification& notification);
+
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 +75,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);
};

Powered by Google App Engine
This is Rietveld 408576698