OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef REMOTING_SIGNALING_XMPP_SIGNAL_STRATEGY_H_ | 5 #ifndef REMOTING_SIGNALING_XMPP_SIGNAL_STRATEGY_H_ |
6 #define REMOTING_SIGNALING_XMPP_SIGNAL_STRATEGY_H_ | 6 #define REMOTING_SIGNALING_XMPP_SIGNAL_STRATEGY_H_ |
7 | 7 |
8 #include "remoting/signaling/signal_strategy.h" | 8 #include "remoting/signaling/signal_strategy.h" |
9 | 9 |
| 10 #include <memory> |
| 11 |
10 #include "base/compiler_specific.h" | 12 #include "base/compiler_specific.h" |
11 #include "base/macros.h" | 13 #include "base/macros.h" |
12 #include "base/memory/ref_counted.h" | 14 #include "base/memory/ref_counted.h" |
13 #include "base/memory/scoped_ptr.h" | |
14 | 15 |
15 namespace net { | 16 namespace net { |
16 class ClientSocketFactory; | 17 class ClientSocketFactory; |
17 class URLRequestContextGetter; | 18 class URLRequestContextGetter; |
18 } // namespace net | 19 } // namespace net |
19 | 20 |
20 namespace remoting { | 21 namespace remoting { |
21 | 22 |
22 // XmppSignalStrategy implements SignalStrategy using direct XMPP connection. | 23 // XmppSignalStrategy implements SignalStrategy using direct XMPP connection. |
23 class XmppSignalStrategy : public SignalStrategy { | 24 class XmppSignalStrategy : public SignalStrategy { |
(...skipping 19 matching lines...) Expand all Loading... |
43 ~XmppSignalStrategy() override; | 44 ~XmppSignalStrategy() override; |
44 | 45 |
45 // SignalStrategy interface. | 46 // SignalStrategy interface. |
46 void Connect() override; | 47 void Connect() override; |
47 void Disconnect() override; | 48 void Disconnect() override; |
48 State GetState() const override; | 49 State GetState() const override; |
49 Error GetError() const override; | 50 Error GetError() const override; |
50 std::string GetLocalJid() const override; | 51 std::string GetLocalJid() const override; |
51 void AddListener(Listener* listener) override; | 52 void AddListener(Listener* listener) override; |
52 void RemoveListener(Listener* listener) override; | 53 void RemoveListener(Listener* listener) override; |
53 bool SendStanza(scoped_ptr<buzz::XmlElement> stanza) override; | 54 bool SendStanza(std::unique_ptr<buzz::XmlElement> stanza) override; |
54 std::string GetNextId() override; | 55 std::string GetNextId() override; |
55 | 56 |
56 // This method is used to update the auth info (for example when the OAuth | 57 // This method is used to update the auth info (for example when the OAuth |
57 // access token is renewed). It is OK to call this even when we are in the | 58 // access token is renewed). It is OK to call this even when we are in the |
58 // CONNECTED state. It will be used on the next Connect() call. | 59 // CONNECTED state. It will be used on the next Connect() call. |
59 void SetAuthInfo(const std::string& username, | 60 void SetAuthInfo(const std::string& username, |
60 const std::string& auth_token); | 61 const std::string& auth_token); |
61 | 62 |
62 private: | 63 private: |
63 class Core; | 64 class Core; |
64 | 65 |
65 scoped_ptr<Core> core_; | 66 std::unique_ptr<Core> core_; |
66 | 67 |
67 DISALLOW_COPY_AND_ASSIGN(XmppSignalStrategy); | 68 DISALLOW_COPY_AND_ASSIGN(XmppSignalStrategy); |
68 }; | 69 }; |
69 | 70 |
70 } // namespace remoting | 71 } // namespace remoting |
71 | 72 |
72 #endif // REMOTING_SIGNALING_XMPP_SIGNAL_STRATEGY_H_ | 73 #endif // REMOTING_SIGNALING_XMPP_SIGNAL_STRATEGY_H_ |
OLD | NEW |