summaryrefslogtreecommitdiffstats
path: root/remoting/host/client_session.cc
diff options
context:
space:
mode:
authorjamiewalch@chromium.org <jamiewalch@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-09-02 05:27:00 +0000
committerjamiewalch@chromium.org <jamiewalch@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-09-02 05:27:00 +0000
commitaf278c44b8168ea9db0cca050fcb1c109badef5a (patch)
treee654d9386ccc2b350f20554a3c603847d62058f4 /remoting/host/client_session.cc
parentf93a77459eb2fe243f8ed4aefa581fb580100147 (diff)
downloadchromium_src-af278c44b8168ea9db0cca050fcb1c109badef5a.zip
chromium_src-af278c44b8168ea9db0cca050fcb1c109badef5a.tar.gz
chromium_src-af278c44b8168ea9db0cca050fcb1c109badef5a.tar.bz2
Implement test-echo extension message and reply.
TEST=Run the following command in the JS console once connected: remoting.clientSession.plugin.sendExtensionMessage('test-echo', <thing to be echoed>) Review URL: https://chromiumcodereview.appspot.com/23491004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@220802 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'remoting/host/client_session.cc')
-rw-r--r--remoting/host/client_session.cc10
1 files changed, 10 insertions, 0 deletions
diff --git a/remoting/host/client_session.cc b/remoting/host/client_session.cc
index b001a39..45439f4 100644
--- a/remoting/host/client_session.cc
+++ b/remoting/host/client_session.cc
@@ -189,6 +189,16 @@ void ClientSession::RequestPairing(
void ClientSession::DeliverClientMessage(
const protocol::ExtensionMessage& message) {
+ if (message.has_type()) {
+ if (message.type() == "test-echo") {
+ protocol::ExtensionMessage reply;
+ reply.set_type("test-echo-reply");
+ if (message.has_data())
+ reply.set_data(message.data().substr(0, 16));
+ connection_->client_stub()->DeliverHostMessage(reply);
+ return;
+ }
+ }
// No messages are currently supported.
LOG(INFO) << "Unexpected message received: "
<< message.type() << ": " << message.data();