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

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

Issue 2827014: Implemented initial version of server-issued notification client. (Closed)
Patch Set: Added DEPS Created 10 years, 6 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
diff --git a/chrome/browser/sync/notifier/cache_invalidation_packet_handler.h b/chrome/browser/sync/notifier/cache_invalidation_packet_handler.h
new file mode 100644
index 0000000000000000000000000000000000000000..2ab1b3dbce443e127cae2ba30c8c3ec834f68e79
--- /dev/null
+++ b/chrome/browser/sync/notifier/cache_invalidation_packet_handler.h
@@ -0,0 +1,58 @@
+// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+//
+// Class that handles the details of sending and receiving client
+// invalidation packets.
+
+#ifndef CHROME_BROWSER_SYNC_NOTIFIER_CACHE_INVALIDATION_PACKET_HANDLER_H_
+#define CHROME_BROWSER_SYNC_NOTIFIER_CACHE_INVALIDATION_PACKET_HANDLER_H_
+
+#include <string>
+
+#include "base/basictypes.h"
+#include "talk/xmpp/jid.h"
+
+namespace buzz {
+class XmppClient;
+} // namespace buzz
+
+namespace invalidation {
+class InvalidationClient;
+class NetworkEndpoint;
+} // namespace invalidation
+
+namespace sync_notifier {
+
+// TODO(akalin): Add a NonThreadSafe member to this class and use it.
+
+class CacheInvalidationPacketHandler {
+ public:
+ // Starts routing packets from |invalidation_client| through
+ // |xmpp_client|. |invalidation_client| must not already be routing
+ // packets through something. Does not take ownership of
+ // |xmpp_client| or |invalidation_client|.
+ CacheInvalidationPacketHandler(
+ buzz::XmppClient* xmpp_client,
+ invalidation::InvalidationClient* invalidation_client);
+
+ // Makes the invalidation client passed into the constructor not
+ // route packets through the XMPP client passed into the constructor
+ // anymore.
+ ~CacheInvalidationPacketHandler();
+
+ private:
+ void HandleOutboundPacket(
+ invalidation::NetworkEndpoint* const& network_endpoint);
+
+ void HandleInboundPacket(const std::string& packet);
+
+ buzz::XmppClient* xmpp_client_;
+ invalidation::InvalidationClient* invalidation_client_;
+
+ DISALLOW_COPY_AND_ASSIGN(CacheInvalidationPacketHandler);
+};
+
+} // namespace sync_notifier
+
+#endif // CHROME_BROWSER_SYNC_NOTIFIER_CACHE_INVALIDATION_PACKET_HANDLER_H_
« no previous file with comments | « chrome/browser/sync/notifier/DEPS ('k') | chrome/browser/sync/notifier/cache_invalidation_packet_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698