summaryrefslogtreecommitdiffstats
path: root/remoting/protocol/channel_dispatcher_base.cc
diff options
context:
space:
mode:
authorsergeyu@chromium.org <sergeyu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-08-22 00:55:58 +0000
committersergeyu@chromium.org <sergeyu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-08-22 00:55:58 +0000
commitefac095a6203050f0c17a4efca9cf3ec01d26850 (patch)
treef5f1d59a7920385b7f454c684e5919a5889c5ad3 /remoting/protocol/channel_dispatcher_base.cc
parent1a5b4b0a81d4a49c8cd252e670efd5a8aff07115 (diff)
downloadchromium_src-efac095a6203050f0c17a4efca9cf3ec01d26850.zip
chromium_src-efac095a6203050f0c17a4efca9cf3ec01d26850.tar.gz
chromium_src-efac095a6203050f0c17a4efca9cf3ec01d26850.tar.bz2
Enable channel multiplexing for control, event and audio channels.
BUG=137135 Review URL: https://chromiumcodereview.appspot.com/10825359 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@152703 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'remoting/protocol/channel_dispatcher_base.cc')
-rw-r--r--remoting/protocol/channel_dispatcher_base.cc18
1 files changed, 17 insertions, 1 deletions
diff --git a/remoting/protocol/channel_dispatcher_base.cc b/remoting/protocol/channel_dispatcher_base.cc
index 7eb88e0..555333d 100644
--- a/remoting/protocol/channel_dispatcher_base.cc
+++ b/remoting/protocol/channel_dispatcher_base.cc
@@ -8,6 +8,7 @@
#include "net/socket/stream_socket.h"
#include "remoting/protocol/channel_factory.h"
#include "remoting/protocol/session.h"
+#include "remoting/protocol/session_config.h"
namespace remoting {
namespace protocol {
@@ -23,9 +24,24 @@ ChannelDispatcherBase::~ChannelDispatcherBase() {
}
void ChannelDispatcherBase::Init(Session* session,
+ const ChannelConfig& config,
const InitializedCallback& callback) {
DCHECK(session);
- channel_factory_ = session->GetTransportChannelFactory();
+ switch (config.transport) {
+ case ChannelConfig::TRANSPORT_MUX_STREAM:
+ channel_factory_ = session->GetMultiplexedChannelFactory();
+ break;
+
+ case ChannelConfig::TRANSPORT_STREAM:
+ channel_factory_ = session->GetTransportChannelFactory();
+ break;
+
+ default:
+ NOTREACHED();
+ callback.Run(false);
+ return;
+ }
+
initialized_callback_ = callback;
channel_factory_->CreateStreamChannel(channel_name_, base::Bind(