| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_JINGLE_GLUE_FAKE_SIGNAL_STRATEGY_H_ | 5 #ifndef REMOTING_JINGLE_GLUE_FAKE_SIGNAL_STRATEGY_H_ |
| 6 #define REMOTING_JINGLE_GLUE_FAKE_SIGNAL_STRATEGY_H_ | 6 #define REMOTING_JINGLE_GLUE_FAKE_SIGNAL_STRATEGY_H_ |
| 7 | 7 |
| 8 #include <list> | 8 #include <list> |
| 9 #include <queue> | 9 #include <queue> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 virtual ~FakeSignalStrategy(); | 26 virtual ~FakeSignalStrategy(); |
| 27 | 27 |
| 28 const std::list<buzz::XmlElement*>& received_messages() { | 28 const std::list<buzz::XmlElement*>& received_messages() { |
| 29 return received_messages_; | 29 return received_messages_; |
| 30 } | 30 } |
| 31 | 31 |
| 32 // SignalStrategy interface. | 32 // SignalStrategy interface. |
| 33 virtual void Connect() OVERRIDE; | 33 virtual void Connect() OVERRIDE; |
| 34 virtual void Disconnect() OVERRIDE; | 34 virtual void Disconnect() OVERRIDE; |
| 35 virtual State GetState() const OVERRIDE; | 35 virtual State GetState() const OVERRIDE; |
| 36 virtual Error GetError() const OVERRIDE; |
| 36 virtual std::string GetLocalJid() const OVERRIDE; | 37 virtual std::string GetLocalJid() const OVERRIDE; |
| 37 virtual void AddListener(Listener* listener) OVERRIDE; | 38 virtual void AddListener(Listener* listener) OVERRIDE; |
| 38 virtual void RemoveListener(Listener* listener) OVERRIDE; | 39 virtual void RemoveListener(Listener* listener) OVERRIDE; |
| 39 virtual bool SendStanza(scoped_ptr<buzz::XmlElement> stanza) OVERRIDE; | 40 virtual bool SendStanza(scoped_ptr<buzz::XmlElement> stanza) OVERRIDE; |
| 40 virtual std::string GetNextId() OVERRIDE; | 41 virtual std::string GetNextId() OVERRIDE; |
| 41 | 42 |
| 42 private: | 43 private: |
| 43 // Called by the |peer_|. Takes ownership of |stanza|. | 44 // Called by the |peer_|. Takes ownership of |stanza|. |
| 44 void OnIncomingMessage(scoped_ptr<buzz::XmlElement> stanza); | 45 void OnIncomingMessage(scoped_ptr<buzz::XmlElement> stanza); |
| 45 | 46 |
| (...skipping 12 matching lines...) Expand all Loading... |
| 58 std::queue<buzz::XmlElement*> pending_messages_; | 59 std::queue<buzz::XmlElement*> pending_messages_; |
| 59 | 60 |
| 60 base::WeakPtrFactory<FakeSignalStrategy> weak_factory_; | 61 base::WeakPtrFactory<FakeSignalStrategy> weak_factory_; |
| 61 | 62 |
| 62 DISALLOW_COPY_AND_ASSIGN(FakeSignalStrategy); | 63 DISALLOW_COPY_AND_ASSIGN(FakeSignalStrategy); |
| 63 }; | 64 }; |
| 64 | 65 |
| 65 } // namespace remoting | 66 } // namespace remoting |
| 66 | 67 |
| 67 #endif // REMOTING_JINGLE_GLUE_FAKE_SIGNAL_STRATEGY_H_ | 68 #endif // REMOTING_JINGLE_GLUE_FAKE_SIGNAL_STRATEGY_H_ |
| OLD | NEW |