| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 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 | 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 #include "remoting/protocol/fake_connection_to_host.h" | 5 #include "remoting/protocol/fake_connection_to_host.h" |
| 6 | 6 |
| 7 #include "remoting/protocol/authenticator.h" | 7 #include "remoting/protocol/authenticator.h" |
| 8 #include "remoting/protocol/transport_context.h" |
| 8 | 9 |
| 9 namespace remoting { | 10 namespace remoting { |
| 10 namespace test { | 11 namespace test { |
| 11 | 12 |
| 12 FakeConnectionToHost::FakeConnectionToHost() | 13 FakeConnectionToHost::FakeConnectionToHost() |
| 13 : state_(INITIALIZING), | 14 : state_(INITIALIZING), |
| 14 session_config_(protocol::SessionConfig::ForTest()) { | 15 session_config_(protocol::SessionConfig::ForTest()) { |
| 15 } | 16 } |
| 16 | 17 |
| 17 FakeConnectionToHost::~FakeConnectionToHost() { | 18 FakeConnectionToHost::~FakeConnectionToHost() { |
| (...skipping 11 matching lines...) Expand all Loading... |
| 29 } | 30 } |
| 30 | 31 |
| 31 void FakeConnectionToHost::set_video_stub(protocol::VideoStub* video_stub) { | 32 void FakeConnectionToHost::set_video_stub(protocol::VideoStub* video_stub) { |
| 32 } | 33 } |
| 33 | 34 |
| 34 void FakeConnectionToHost::set_audio_stub(protocol::AudioStub* audio_stub) { | 35 void FakeConnectionToHost::set_audio_stub(protocol::AudioStub* audio_stub) { |
| 35 } | 36 } |
| 36 | 37 |
| 37 void FakeConnectionToHost::Connect( | 38 void FakeConnectionToHost::Connect( |
| 38 SignalStrategy* signal_strategy, | 39 SignalStrategy* signal_strategy, |
| 39 scoped_ptr<protocol::TransportFactory> transport_factory, | 40 scoped_refptr<protocol::TransportContext> transport_context, |
| 40 scoped_ptr<protocol::Authenticator> authenticator, | 41 scoped_ptr<protocol::Authenticator> authenticator, |
| 41 const std::string& host_jid, | 42 const std::string& host_jid, |
| 42 HostEventCallback* event_callback) { | 43 HostEventCallback* event_callback) { |
| 43 DCHECK(event_callback); | 44 DCHECK(event_callback); |
| 44 | 45 |
| 45 event_callback_ = event_callback; | 46 event_callback_ = event_callback; |
| 46 | 47 |
| 47 SetState(CONNECTING, protocol::OK); | 48 SetState(CONNECTING, protocol::OK); |
| 48 } | 49 } |
| 49 | 50 |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 110 DCHECK(state == FAILED || error == protocol::OK); | 111 DCHECK(state == FAILED || error == protocol::OK); |
| 111 | 112 |
| 112 if (state != state_) { | 113 if (state != state_) { |
| 113 state_ = state; | 114 state_ = state; |
| 114 event_callback_->OnConnectionState(state_, error); | 115 event_callback_->OnConnectionState(state_, error); |
| 115 } | 116 } |
| 116 } | 117 } |
| 117 | 118 |
| 118 } // namespace test | 119 } // namespace test |
| 119 } // namespace remoting | 120 } // namespace remoting |
| OLD | NEW |