Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2015 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 #ifndef REMOTING_HOST_GCD_NOTIFICATION_SUBSCRIBER_H_ | |
| 6 #define REMOTING_HOST_GCD_NOTIFICATION_SUBSCRIBER_H_ | |
| 7 | |
| 8 #include <string> | |
| 9 | |
| 10 #include "base/basictypes.h" | |
| 11 #include "base/memory/scoped_ptr.h" | |
| 12 #include "remoting/signaling/signal_strategy.h" | |
| 13 | |
| 14 namespace remoting { | |
| 15 | |
| 16 class IqSender; | |
| 17 class IqRequest; | |
| 18 | |
| 19 // An object that subscribes to push notifications using an XMPP | |
| 20 // channel. The notifications themselves are ignored, but creating a | |
| 21 // subscription is necessary, e.g., for GCD to see a device as online. | |
| 22 class PushNotificationSubscriber : public SignalStrategy::Listener { | |
| 23 public: | |
| 24 PushNotificationSubscriber(SignalStrategy* signal_strategy, | |
| 25 const std::string& push_channel); | |
|
Sergey Ulanov
2015/05/16 00:56:08
Can you please replace this with a list of subscri
John Williams
2015/05/16 02:10:07
Done.
| |
| 26 ~PushNotificationSubscriber() override; | |
| 27 | |
| 28 private: | |
| 29 // SignalStrategy::Listener interface. | |
| 30 void OnSignalStrategyStateChange(SignalStrategy::State state) override; | |
| 31 bool OnSignalStrategyIncomingStanza(const buzz::XmlElement* stanza) override; | |
| 32 | |
| 33 void OnSubscriptionResult(IqRequest* request, | |
| 34 const buzz::XmlElement* response); | |
| 35 | |
| 36 SignalStrategy* signal_strategy_; | |
| 37 std::string push_channel_; | |
| 38 scoped_ptr<IqSender> iq_sender_; | |
| 39 scoped_ptr<IqRequest> iq_request_; | |
| 40 | |
| 41 DISALLOW_COPY_AND_ASSIGN(PushNotificationSubscriber); | |
| 42 }; | |
| 43 | |
| 44 } // namespace remoting | |
| 45 | |
| 46 #endif // REMOTING_HOST_GCD_NOTIFICATION_SUBSCRIBER_H_ | |
| OLD | NEW |