| 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> | 10 #include <memory> |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 net::ClientSocketFactory* socket_factory, | 43 net::ClientSocketFactory* socket_factory, |
| 44 const scoped_refptr<net::URLRequestContextGetter>& request_context_getter, | 44 const scoped_refptr<net::URLRequestContextGetter>& request_context_getter, |
| 45 const XmppServerConfig& xmpp_server_config); | 45 const XmppServerConfig& xmpp_server_config); |
| 46 ~XmppSignalStrategy() override; | 46 ~XmppSignalStrategy() override; |
| 47 | 47 |
| 48 // SignalStrategy interface. | 48 // SignalStrategy interface. |
| 49 void Connect() override; | 49 void Connect() override; |
| 50 void Disconnect() override; | 50 void Disconnect() override; |
| 51 State GetState() const override; | 51 State GetState() const override; |
| 52 Error GetError() const override; | 52 Error GetError() const override; |
| 53 std::string GetLocalJid() const override; | 53 const SignalingAddress& GetLocalAddress() const override; |
| 54 void AddListener(Listener* listener) override; | 54 void AddListener(Listener* listener) override; |
| 55 void RemoveListener(Listener* listener) override; | 55 void RemoveListener(Listener* listener) override; |
| 56 bool SendStanza(std::unique_ptr<buzz::XmlElement> stanza) override; | 56 bool SendStanza(std::unique_ptr<buzz::XmlElement> stanza) override; |
| 57 std::string GetNextId() override; | 57 std::string GetNextId() override; |
| 58 | 58 |
| 59 // This method is used to update the auth info (for example when the OAuth | 59 // This method is used to update the auth info (for example when the OAuth |
| 60 // access token is renewed). It is OK to call this even when we are in the | 60 // access token is renewed). It is OK to call this even when we are in the |
| 61 // CONNECTED state. It will be used on the next Connect() call. | 61 // CONNECTED state. It will be used on the next Connect() call. |
| 62 void SetAuthInfo(const std::string& username, | 62 void SetAuthInfo(const std::string& username, |
| 63 const std::string& auth_token); | 63 const std::string& auth_token); |
| 64 | 64 |
| 65 private: | 65 private: |
| 66 // This ensures that even if a Listener deletes the current instance during | 66 // This ensures that even if a Listener deletes the current instance during |
| 67 // OnSignalStrategyIncomingStanza(), we can delete |core_| asynchronously. | 67 // OnSignalStrategyIncomingStanza(), we can delete |core_| asynchronously. |
| 68 class Core; | 68 class Core; |
| 69 | 69 |
| 70 std::unique_ptr<Core> core_; | 70 std::unique_ptr<Core> core_; |
| 71 | 71 |
| 72 DISALLOW_COPY_AND_ASSIGN(XmppSignalStrategy); | 72 DISALLOW_COPY_AND_ASSIGN(XmppSignalStrategy); |
| 73 }; | 73 }; |
| 74 | 74 |
| 75 } // namespace remoting | 75 } // namespace remoting |
| 76 | 76 |
| 77 #endif // REMOTING_SIGNALING_XMPP_SIGNAL_STRATEGY_H_ | 77 #endif // REMOTING_SIGNALING_XMPP_SIGNAL_STRATEGY_H_ |
| OLD | NEW |