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

Unified Diff: remoting/protocol/channel_dispatcher_base.cc

Issue 2146213002: Add support for dynamic channels in WebrtcTransport. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 4 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « remoting/protocol/channel_dispatcher_base.h ('k') | remoting/protocol/client_video_dispatcher_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/protocol/channel_dispatcher_base.cc
diff --git a/remoting/protocol/channel_dispatcher_base.cc b/remoting/protocol/channel_dispatcher_base.cc
index 274c0d5a58dffc4c1695bfca77cfc85dac32b888..97f3be5e4857ae9076d177b159acdea79b33658d 100644
--- a/remoting/protocol/channel_dispatcher_base.cc
+++ b/remoting/protocol/channel_dispatcher_base.cc
@@ -31,15 +31,29 @@ void ChannelDispatcherBase::Init(MessageChannelFactory* channel_factory,
&ChannelDispatcherBase::OnChannelReady, base::Unretained(this)));
}
+void ChannelDispatcherBase::Init(std::unique_ptr<MessagePipe> message_pipe,
+ EventHandler* event_handler) {
+ event_handler_ = event_handler;
+ OnChannelReady(std::move(message_pipe));
+}
+
void ChannelDispatcherBase::OnChannelReady(
std::unique_ptr<MessagePipe> message_pipe) {
channel_factory_ = nullptr;
message_pipe_ = std::move(message_pipe);
- message_pipe_->StartReceiving(base::Bind(
- &ChannelDispatcherBase::OnIncomingMessage, base::Unretained(this)));
+ message_pipe_->Start(this);
event_handler_->OnChannelInitialized(this);
}
+void ChannelDispatcherBase::OnMessageReceived(
+ std::unique_ptr<CompoundBuffer> message) {
+ OnIncomingMessage(std::move(message));
+}
+
+void ChannelDispatcherBase::OnMessagePipeClosed() {
+ event_handler_->OnChannelClosed(this);
+}
+
} // namespace protocol
} // namespace remoting
« no previous file with comments | « remoting/protocol/channel_dispatcher_base.h ('k') | remoting/protocol/client_video_dispatcher_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698