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

Unified Diff: remoting/protocol/client_control_dispatcher.cc

Issue 22477006: Added JsonMessage to the control channel. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 4 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
Index: remoting/protocol/client_control_dispatcher.cc
diff --git a/remoting/protocol/client_control_dispatcher.cc b/remoting/protocol/client_control_dispatcher.cc
index 8bb918efcb58f6591d37953a59f69f1d6ea5b41d..12e1c9b32975d0bcee8046e4973ad0028d7fb4a4 100644
--- a/remoting/protocol/client_control_dispatcher.cc
+++ b/remoting/protocol/client_control_dispatcher.cc
@@ -74,6 +74,13 @@ void ClientControlDispatcher::RequestPairing(
writer_.Write(SerializeAndFrameMessage(message), base::Closure());
}
+void ClientControlDispatcher::ProcessClientJson(
+ const JsonMessage& json_message) {
+ ControlMessage message;
+ message.mutable_json_message()->CopyFrom(json_message);
+ writer_.Write(SerializeAndFrameMessage(message), base::Closure());
+}
+
void ClientControlDispatcher::OnMessageReceived(
scoped_ptr<ControlMessage> message, const base::Closure& done_task) {
DCHECK(client_stub_);
@@ -88,6 +95,8 @@ void ClientControlDispatcher::OnMessageReceived(
client_stub_->SetCursorShape(message->cursor_shape());
} else if (message->has_pairing_response()) {
client_stub_->SetPairingResponse(message->pairing_response());
+ } else if (message->has_json_message()) {
+ client_stub_->ProcessHostJson(message->json_message());
} else {
LOG(WARNING) << "Unknown control message received.";
}

Powered by Google App Engine
This is Rietveld 408576698