summaryrefslogtreecommitdiffstats
path: root/remoting/protocol/host_control_dispatcher.cc
diff options
context:
space:
mode:
authorsergeyu <sergeyu@chromium.org>2016-02-03 13:11:30 -0800
committerCommit bot <commit-bot@chromium.org>2016-02-03 21:13:28 +0000
commitf1005f6e964841763ae3792ff6aea399f9514a67 (patch)
treec3f82c915b13c1fa30319a24de6d53a74a3937bf /remoting/protocol/host_control_dispatcher.cc
parenta5501522684dbb5968df45fc0119855fcc3ac900 (diff)
downloadchromium_src-f1005f6e964841763ae3792ff6aea399f9514a67.zip
chromium_src-f1005f6e964841763ae3792ff6aea399f9514a67.tar.gz
chromium_src-f1005f6e964841763ae3792ff6aea399f9514a67.tar.bz2
Add MessagePipe interface. Use it in ChannelDispatcherBase.
In WebRTC data streams are message-based, so the message framing mechanism use for the old protocol doesn't make sense for the WebRTC-based protocol. The new MessagePipe represents an abstract messaging channel. StreamMessagePipeAdapter implements framing for the old protocol. A different MessagePipe is going to be used for WebRTC-based protocol. BUG=547158 Review URL: https://codereview.chromium.org/1649063003 Cr-Commit-Position: refs/heads/master@{#373340}
Diffstat (limited to 'remoting/protocol/host_control_dispatcher.cc')
-rw-r--r--remoting/protocol/host_control_dispatcher.cc12
1 files changed, 7 insertions, 5 deletions
diff --git a/remoting/protocol/host_control_dispatcher.cc b/remoting/protocol/host_control_dispatcher.cc
index fb8aee9..627eb7e 100644
--- a/remoting/protocol/host_control_dispatcher.cc
+++ b/remoting/protocol/host_control_dispatcher.cc
@@ -6,11 +6,13 @@
#include "base/callback_helpers.h"
#include "net/socket/stream_socket.h"
+#include "remoting/base/compound_buffer.h"
#include "remoting/base/constants.h"
#include "remoting/proto/control.pb.h"
#include "remoting/proto/internal.pb.h"
#include "remoting/protocol/clipboard_stub.h"
#include "remoting/protocol/host_stub.h"
+#include "remoting/protocol/message_pipe.h"
#include "remoting/protocol/message_serialization.h"
namespace remoting {
@@ -24,34 +26,34 @@ void HostControlDispatcher::SetCapabilities(
const Capabilities& capabilities) {
ControlMessage message;
message.mutable_capabilities()->CopyFrom(capabilities);
- writer()->Write(SerializeAndFrameMessage(message), base::Closure());
+ message_pipe()->Send(&message, base::Closure());
}
void HostControlDispatcher::SetPairingResponse(
const PairingResponse& pairing_response) {
ControlMessage message;
message.mutable_pairing_response()->CopyFrom(pairing_response);
- writer()->Write(SerializeAndFrameMessage(message), base::Closure());
+ message_pipe()->Send(&message, base::Closure());
}
void HostControlDispatcher::DeliverHostMessage(
const ExtensionMessage& message) {
ControlMessage control_message;
control_message.mutable_extension_message()->CopyFrom(message);
- writer()->Write(SerializeAndFrameMessage(control_message), base::Closure());
+ message_pipe()->Send(&control_message, base::Closure());
}
void HostControlDispatcher::InjectClipboardEvent(const ClipboardEvent& event) {
ControlMessage message;
message.mutable_clipboard_event()->CopyFrom(event);
- writer()->Write(SerializeAndFrameMessage(message), base::Closure());
+ message_pipe()->Send(&message, base::Closure());
}
void HostControlDispatcher::SetCursorShape(
const CursorShapeInfo& cursor_shape) {
ControlMessage message;
message.mutable_cursor_shape()->CopyFrom(cursor_shape);
- writer()->Write(SerializeAndFrameMessage(message), base::Closure());
+ message_pipe()->Send(&message, base::Closure());
}
void HostControlDispatcher::OnIncomingMessage(