| OLD | NEW |
| (Empty) | |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 // |
| 5 // Class that handles the details of sending and receiving client |
| 6 // invalidation packets. |
| 7 |
| 8 #ifndef CHROME_BROWSER_SYNC_NOTIFIER_CACHE_INVALIDATION_PACKET_HANDLER_H_ |
| 9 #define CHROME_BROWSER_SYNC_NOTIFIER_CACHE_INVALIDATION_PACKET_HANDLER_H_ |
| 10 |
| 11 #include <string> |
| 12 |
| 13 #include "base/basictypes.h" |
| 14 #include "talk/xmpp/jid.h" |
| 15 |
| 16 namespace buzz { |
| 17 class XmppClient; |
| 18 } // namespace buzz |
| 19 |
| 20 namespace invalidation { |
| 21 class InvalidationClient; |
| 22 class NetworkEndpoint; |
| 23 } // namespace invalidation |
| 24 |
| 25 namespace sync_notifier { |
| 26 |
| 27 // TODO(akalin): Add a NonThreadSafe member to this class and use it. |
| 28 |
| 29 class CacheInvalidationPacketHandler { |
| 30 public: |
| 31 // Starts routing packets from |invalidation_client| through |
| 32 // |xmpp_client|. |invalidation_client| must not already be routing |
| 33 // packets through something. Does not take ownership of |
| 34 // |xmpp_client| or |invalidation_client|. |
| 35 CacheInvalidationPacketHandler( |
| 36 buzz::XmppClient* xmpp_client, |
| 37 invalidation::InvalidationClient* invalidation_client); |
| 38 |
| 39 // Makes the invalidation client passed into the constructor not |
| 40 // route packets through the XMPP client passed into the constructor |
| 41 // anymore. |
| 42 ~CacheInvalidationPacketHandler(); |
| 43 |
| 44 private: |
| 45 void HandleOutboundPacket( |
| 46 invalidation::NetworkEndpoint* const& network_endpoint); |
| 47 |
| 48 void HandleInboundPacket(const std::string& packet); |
| 49 |
| 50 buzz::XmppClient* xmpp_client_; |
| 51 invalidation::InvalidationClient* invalidation_client_; |
| 52 |
| 53 DISALLOW_COPY_AND_ASSIGN(CacheInvalidationPacketHandler); |
| 54 }; |
| 55 |
| 56 } // namespace sync_notifier |
| 57 |
| 58 #endif // CHROME_BROWSER_SYNC_NOTIFIER_CACHE_INVALIDATION_PACKET_HANDLER_H_ |
| OLD | NEW |