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

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

Issue 1420273002: Add TransportSession interface to prepare for WebRTC-based transport. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 1 month 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
« no previous file with comments | « remoting/protocol/fake_session.h ('k') | remoting/protocol/ice_transport_factory.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #include "remoting/protocol/fake_session.h" 5 #include "remoting/protocol/fake_session.h"
6 6
7 namespace remoting { 7 namespace remoting {
8 namespace protocol { 8 namespace protocol {
9 9
10 const char kTestJid[] = "host1@gmail.com/chromoting123"; 10 const char kTestJid[] = "host1@gmail.com/chromoting123";
11 11
12 FakeTransportSession::FakeTransportSession() {}
13 FakeTransportSession::~FakeTransportSession() {}
14
15 void FakeTransportSession::Start(EventHandler* event_handler,
16 Authenticator* authenticator) {
17 NOTREACHED();
18 }
19
20 bool FakeTransportSession::ProcessTransportInfo(
21 buzz::XmlElement* transport_info) {
22 NOTREACHED();
23 return true;
24 }
25
26 DatagramChannelFactory* FakeTransportSession::GetDatagramChannelFactory() {
27 NOTIMPLEMENTED();
28 return nullptr;
29 }
30
31 FakeStreamChannelFactory* FakeTransportSession::GetStreamChannelFactory() {
32 return &channel_factory_;
33 }
34
35 FakeStreamChannelFactory* FakeTransportSession::GetMultiplexedChannelFactory() {
36 return &channel_factory_;
37 }
38
12 FakeSession::FakeSession() 39 FakeSession::FakeSession()
13 : event_handler_(nullptr), 40 : event_handler_(nullptr),
14 config_(SessionConfig::ForTest()), 41 config_(SessionConfig::ForTest()),
15 jid_(kTestJid), 42 jid_(kTestJid),
16 error_(OK), 43 error_(OK),
17 closed_(false) {} 44 closed_(false) {}
18 45
19 FakeSession::~FakeSession() {} 46 FakeSession::~FakeSession() {}
20 47
21 void FakeSession::SetEventHandler(EventHandler* event_handler) { 48 void FakeSession::SetEventHandler(EventHandler* event_handler) {
22 event_handler_ = event_handler; 49 event_handler_ = event_handler;
23 } 50 }
24 51
25 ErrorCode FakeSession::error() { 52 ErrorCode FakeSession::error() {
26 return error_; 53 return error_;
27 } 54 }
28 55
29 const std::string& FakeSession::jid() { 56 const std::string& FakeSession::jid() {
30 return jid_; 57 return jid_;
31 } 58 }
32 59
33 const SessionConfig& FakeSession::config() { 60 const SessionConfig& FakeSession::config() {
34 return *config_; 61 return *config_;
35 } 62 }
36 63
37 StreamChannelFactory* FakeSession::GetTransportChannelFactory() { 64 FakeTransportSession* FakeSession::GetTransportSession() {
38 return &channel_factory_; 65 return &transport_session_;
39 } 66 }
40 67
41 StreamChannelFactory* FakeSession::GetMultiplexedChannelFactory() { 68 FakeStreamChannelFactory* FakeSession::GetQuicChannelFactory() {
42 return &channel_factory_; 69 return transport_session_.GetStreamChannelFactory();
43 }
44
45 StreamChannelFactory* FakeSession::GetQuicChannelFactory() {
46 return &channel_factory_;
47 } 70 }
48 71
49 void FakeSession::Close() { 72 void FakeSession::Close() {
50 closed_ = true; 73 closed_ = true;
51 } 74 }
52 75
53 } // namespace protocol 76 } // namespace protocol
54 } // namespace remoting 77 } // namespace remoting
OLDNEW
« no previous file with comments | « remoting/protocol/fake_session.h ('k') | remoting/protocol/ice_transport_factory.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698