Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(64)

Side by Side Diff: remoting/protocol/fake_session.cc

Issue 7605018: Simplify channel creation callbacks in remoting::Session interface. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 #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
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after
203 FakeUdpSocket* FakeSession::GetDatagramChannel(const std::string& name) { 203 FakeUdpSocket* FakeSession::GetDatagramChannel(const std::string& name) {
204 return datagram_channels_[name]; 204 return datagram_channels_[name];
205 } 205 }
206 206
207 void FakeSession::SetStateChangeCallback(StateChangeCallback* callback) { 207 void FakeSession::SetStateChangeCallback(StateChangeCallback* callback) {
208 callback_.reset(callback); 208 callback_.reset(callback);
209 } 209 }
210 210
211 void FakeSession::CreateStreamChannel( 211 void FakeSession::CreateStreamChannel(
212 const std::string& name, const StreamChannelCallback& callback) { 212 const std::string& name, const StreamChannelCallback& callback) {
213 LOG(ERROR) << " creating channel " << name;
214 FakeSocket* channel = new FakeSocket(); 213 FakeSocket* channel = new FakeSocket();
215 stream_channels_[name] = channel; 214 stream_channels_[name] = channel;
216 callback.Run(name, channel); 215 callback.Run(channel);
217 } 216 }
218 217
219 void FakeSession::CreateDatagramChannel( 218 void FakeSession::CreateDatagramChannel(
220 const std::string& name, const DatagramChannelCallback& callback) { 219 const std::string& name, const DatagramChannelCallback& callback) {
221 FakeUdpSocket* channel = new FakeUdpSocket(); 220 FakeUdpSocket* channel = new FakeUdpSocket();
222 datagram_channels_[name] = channel; 221 datagram_channels_[name] = channel;
223 callback.Run(name, channel); 222 callback.Run(channel);
224 } 223 }
225 224
226 FakeSocket* FakeSession::control_channel() { 225 FakeSocket* FakeSession::control_channel() {
227 return &control_channel_; 226 return &control_channel_;
228 } 227 }
229 228
230 FakeSocket* FakeSession::event_channel() { 229 FakeSocket* FakeSession::event_channel() {
231 return &event_channel_; 230 return &event_channel_;
232 } 231 }
233 232
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
271 const std::string& FakeSession::shared_secret() { 270 const std::string& FakeSession::shared_secret() {
272 return shared_secret_; 271 return shared_secret_;
273 } 272 }
274 273
275 void FakeSession::Close() { 274 void FakeSession::Close() {
276 closed_ = true; 275 closed_ = true;
277 } 276 }
278 277
279 } // namespace protocol 278 } // namespace protocol
280 } // namespace remoting 279 } // namespace remoting
OLDNEW
« no previous file with comments | « no previous file | remoting/protocol/jingle_datagram_connector.cc » ('j') | remoting/protocol/rtp_video_reader.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698