Index: remoting/protocol/host_control_dispatcher.cc |
diff --git a/remoting/protocol/host_control_dispatcher.cc b/remoting/protocol/host_control_dispatcher.cc |
index 2b067d74cdf2d171ed4e6e6afc4467838259673a..fb8aee94188bc111745ec09d893eef012fd2c32e 100644 |
--- a/remoting/protocol/host_control_dispatcher.cc |
+++ b/remoting/protocol/host_control_dispatcher.cc |
@@ -17,16 +17,8 @@ namespace remoting { |
namespace protocol { |
HostControlDispatcher::HostControlDispatcher() |
- : ChannelDispatcherBase(kControlChannelName), |
- clipboard_stub_(nullptr), |
- host_stub_(nullptr), |
- parser_(base::Bind(&HostControlDispatcher::OnMessageReceived, |
- base::Unretained(this)), |
- reader()) { |
-} |
- |
-HostControlDispatcher::~HostControlDispatcher() { |
-} |
+ : ChannelDispatcherBase(kControlChannelName) {} |
+HostControlDispatcher::~HostControlDispatcher() {} |
void HostControlDispatcher::SetCapabilities( |
const Capabilities& capabilities) { |
@@ -62,11 +54,16 @@ void HostControlDispatcher::SetCursorShape( |
writer()->Write(SerializeAndFrameMessage(message), base::Closure()); |
} |
-void HostControlDispatcher::OnMessageReceived( |
- scoped_ptr<ControlMessage> message) { |
+void HostControlDispatcher::OnIncomingMessage( |
+ scoped_ptr<CompoundBuffer> buffer) { |
DCHECK(clipboard_stub_); |
DCHECK(host_stub_); |
+ scoped_ptr<ControlMessage> message = |
+ ParseMessage<ControlMessage>(buffer.get()); |
+ if (!message) |
+ return; |
+ |
if (message->has_clipboard_event()) { |
clipboard_stub_->InjectClipboardEvent(message->clipboard_event()); |
} else if (message->has_client_resolution()) { |