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

Side by Side Diff: remoting/signaling/gcd_notification_subscriber.h

Issue 1123153002: Added class to subscribe to GCD notifications over XMPP. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@host-xmpp-connect2a
Patch Set: revised unit test Created 5 years, 7 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 unified diff | Download patch
OLDNEW
(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 notifications from GCD using an XMPP
20 // channel. No actual notifications are used, but the subscription is
21 // necessary in order for GCD to consider a device online.
22 class GcdNotificationSubscriber : public SignalStrategy::Listener {
23 public:
24 GcdNotificationSubscriber(SignalStrategy* signal_strategy);
25 ~GcdNotificationSubscriber() override;
26
27 private:
28 // SignalStrategy::Listener interface.
29 void OnSignalStrategyStateChange(SignalStrategy::State state) override;
30 bool OnSignalStrategyIncomingStanza(const buzz::XmlElement* stanza) override;
31
32 void OnSubscriptionResult(IqRequest* request,
33 const buzz::XmlElement* response);
34
35 SignalStrategy* signal_strategy_;
36 scoped_ptr<IqSender> iq_sender_;
37 scoped_ptr<IqRequest> iq_request_;
38
39 DISALLOW_COPY_AND_ASSIGN(GcdNotificationSubscriber);
40 };
41
42 } // namespace remoting
43
44 #endif // REMOTING_HOST_GCD_NOTIFICATION_SUBSCRIBER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698