| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_PROTOCOL_FAKE_SESSION_H_ | 5 #ifndef REMOTING_PROTOCOL_FAKE_SESSION_H_ |
| 6 #define REMOTING_PROTOCOL_FAKE_SESSION_H_ | 6 #define REMOTING_PROTOCOL_FAKE_SESSION_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 123 public: | 123 public: |
| 124 FakeSession(); | 124 FakeSession(); |
| 125 virtual ~FakeSession(); | 125 virtual ~FakeSession(); |
| 126 | 126 |
| 127 StateChangeCallback* state_change_callback() { return callback_.get(); } | 127 StateChangeCallback* state_change_callback() { return callback_.get(); } |
| 128 | 128 |
| 129 void set_message_loop(MessageLoop* message_loop) { | 129 void set_message_loop(MessageLoop* message_loop) { |
| 130 message_loop_ = message_loop; | 130 message_loop_ = message_loop; |
| 131 } | 131 } |
| 132 | 132 |
| 133 void set_error(Session::Error error) { error_ = error; } |
| 134 |
| 133 bool is_closed() const { return closed_; } | 135 bool is_closed() const { return closed_; } |
| 134 | 136 |
| 135 FakeSocket* GetStreamChannel(const std::string& name); | 137 FakeSocket* GetStreamChannel(const std::string& name); |
| 136 FakeUdpSocket* GetDatagramChannel(const std::string& name); | 138 FakeUdpSocket* GetDatagramChannel(const std::string& name); |
| 137 | 139 |
| 138 // Session interface. | 140 // Session interface. |
| 139 virtual void SetStateChangeCallback(StateChangeCallback* callback); | 141 virtual void SetStateChangeCallback(StateChangeCallback* callback); |
| 140 | 142 |
| 143 virtual Session::Error error(); |
| 144 |
| 141 virtual void CreateStreamChannel( | 145 virtual void CreateStreamChannel( |
| 142 const std::string& name, const StreamChannelCallback& callback); | 146 const std::string& name, const StreamChannelCallback& callback); |
| 143 virtual void CreateDatagramChannel( | 147 virtual void CreateDatagramChannel( |
| 144 const std::string& name, const DatagramChannelCallback& callback); | 148 const std::string& name, const DatagramChannelCallback& callback); |
| 145 | 149 |
| 146 virtual FakeSocket* control_channel(); | 150 virtual FakeSocket* control_channel(); |
| 147 virtual FakeSocket* event_channel(); | 151 virtual FakeSocket* event_channel(); |
| 148 | 152 |
| 149 virtual const std::string& jid(); | 153 virtual const std::string& jid(); |
| 150 | 154 |
| (...skipping 21 matching lines...) Expand all Loading... |
| 172 | 176 |
| 173 std::map<std::string, FakeSocket*> stream_channels_; | 177 std::map<std::string, FakeSocket*> stream_channels_; |
| 174 std::map<std::string, FakeUdpSocket*> datagram_channels_; | 178 std::map<std::string, FakeUdpSocket*> datagram_channels_; |
| 175 | 179 |
| 176 std::string initiator_token_; | 180 std::string initiator_token_; |
| 177 std::string receiver_token_; | 181 std::string receiver_token_; |
| 178 | 182 |
| 179 std::string shared_secret_; | 183 std::string shared_secret_; |
| 180 | 184 |
| 181 std::string jid_; | 185 std::string jid_; |
| 186 |
| 187 Session::Error error_; |
| 182 bool closed_; | 188 bool closed_; |
| 183 | 189 |
| 184 DISALLOW_COPY_AND_ASSIGN(FakeSession); | 190 DISALLOW_COPY_AND_ASSIGN(FakeSession); |
| 185 }; | 191 }; |
| 186 | 192 |
| 187 } // namespace protocol | 193 } // namespace protocol |
| 188 } // namespace remoting | 194 } // namespace remoting |
| 189 | 195 |
| 190 #endif // REMOTING_PROTOCOL_FAKE_SESSION_H_ | 196 #endif // REMOTING_PROTOCOL_FAKE_SESSION_H_ |
| OLD | NEW |