OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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_session.h" | 5 #include "remoting/protocol/fake_session.h" |
6 | 6 |
7 #include "base/message_loop.h" | 7 #include "base/message_loop.h" |
8 #include "net/base/io_buffer.h" | 8 #include "net/base/io_buffer.h" |
9 #include "net/base/net_errors.h" | 9 #include "net/base/net_errors.h" |
10 | 10 |
11 namespace remoting { | 11 namespace remoting { |
12 | |
13 namespace protocol { | 12 namespace protocol { |
14 | 13 |
15 const char kTestJid[] = "host1@gmail.com/chromoting123"; | 14 const char kTestJid[] = "host1@gmail.com/chromoting123"; |
16 | 15 |
17 FakeSocket::FakeSocket() | 16 FakeSocket::FakeSocket() |
18 : read_pending_(false), | 17 : read_pending_(false), |
19 input_pos_(0) { | 18 input_pos_(0) { |
20 } | 19 } |
21 | 20 |
22 FakeSocket::~FakeSocket() { | 21 FakeSocket::~FakeSocket() { |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
65 bool FakeSocket::SetReceiveBufferSize(int32 size) { | 64 bool FakeSocket::SetReceiveBufferSize(int32 size) { |
66 NOTIMPLEMENTED(); | 65 NOTIMPLEMENTED(); |
67 return false; | 66 return false; |
68 } | 67 } |
69 bool FakeSocket::SetSendBufferSize(int32 size) { | 68 bool FakeSocket::SetSendBufferSize(int32 size) { |
70 NOTIMPLEMENTED(); | 69 NOTIMPLEMENTED(); |
71 return false; | 70 return false; |
72 } | 71 } |
73 | 72 |
74 FakeSession::FakeSession() | 73 FakeSession::FakeSession() |
75 : candidate_config_(CandidateChromotocolConfig::CreateDefault()), | 74 : candidate_config_(CandidateSessionConfig::CreateDefault()), |
76 config_(ChromotocolConfig::CreateDefault()), | 75 config_(SessionConfig::CreateDefault()), |
77 message_loop_(NULL), | 76 message_loop_(NULL), |
78 jid_(kTestJid) { | 77 jid_(kTestJid) { |
79 } | 78 } |
80 | 79 |
81 FakeSession::~FakeSession() { } | 80 FakeSession::~FakeSession() { } |
82 | 81 |
83 void FakeSession::SetStateChangeCallback( | 82 void FakeSession::SetStateChangeCallback( |
84 StateChangeCallback* callback) { | 83 StateChangeCallback* callback) { |
85 callback_.reset(callback); | 84 callback_.reset(callback); |
86 } | 85 } |
(...skipping 19 matching lines...) Expand all Loading... |
106 } | 105 } |
107 | 106 |
108 const std::string& FakeSession::jid() { | 107 const std::string& FakeSession::jid() { |
109 return jid_; | 108 return jid_; |
110 } | 109 } |
111 | 110 |
112 MessageLoop* FakeSession::message_loop() { | 111 MessageLoop* FakeSession::message_loop() { |
113 return message_loop_; | 112 return message_loop_; |
114 } | 113 } |
115 | 114 |
116 const CandidateChromotocolConfig* | 115 const CandidateSessionConfig* FakeSession::candidate_config() { |
117 FakeSession::candidate_config() { | |
118 return candidate_config_.get(); | 116 return candidate_config_.get(); |
119 } | 117 } |
120 | 118 |
121 const ChromotocolConfig* FakeSession::config() { | 119 const SessionConfig* FakeSession::config() { |
122 CHECK(config_.get()); | 120 CHECK(config_.get()); |
123 return config_.get(); | 121 return config_.get(); |
124 } | 122 } |
125 | 123 |
126 void FakeSession::set_config(const ChromotocolConfig* config) { | 124 void FakeSession::set_config(const SessionConfig* config) { |
127 config_.reset(config); | 125 config_.reset(config); |
128 } | 126 } |
129 | 127 |
130 void FakeSession::Close(Task* closed_task) { | 128 void FakeSession::Close(Task* closed_task) { |
131 closed_ = true; | 129 closed_ = true; |
132 closed_task->Run(); | 130 closed_task->Run(); |
133 delete closed_task; | 131 delete closed_task; |
134 } | 132 } |
135 | 133 |
136 } // namespace protocol | 134 } // namespace protocol |
137 | |
138 } // namespace remoting | 135 } // namespace remoting |
OLD | NEW |