diff options
author | hclam@chromium.org <hclam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-11-09 02:22:43 +0000 |
---|---|---|
committer | hclam@chromium.org <hclam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-11-09 02:22:43 +0000 |
commit | 35b9c560f122a92d671e55985fd0161293961ceb (patch) | |
tree | 919367302b47900ce396684e9e1188d70cd5eca6 /remoting/protocol/client_control_sender.h | |
parent | d78482a45263f6fb46af84a766f9407e54c2ede7 (diff) | |
download | chromium_src-35b9c560f122a92d671e55985fd0161293961ceb.zip chromium_src-35b9c560f122a92d671e55985fd0161293961ceb.tar.gz chromium_src-35b9c560f122a92d671e55985fd0161293961ceb.tar.bz2 |
Implementation of InputStub for chromoting
BUG=none
TEST=none
Review URL: http://codereview.chromium.org/4533001
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@65473 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'remoting/protocol/client_control_sender.h')
-rw-r--r-- | remoting/protocol/client_control_sender.h | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/remoting/protocol/client_control_sender.h b/remoting/protocol/client_control_sender.h new file mode 100644 index 0000000..6d9b06f --- /dev/null +++ b/remoting/protocol/client_control_sender.h @@ -0,0 +1,49 @@ +// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Implementation of ClientStub using sockets created from jingle connection. +// It sends messages through the socket after serializing it. +// +// Object of this class can only be created by ConnectionToClient. +// +// This class can be used on any thread. + +#ifndef REMOTING_PROTOCOL_CLIENT_STUB_IMPL_H_ +#define REMOTING_PROTOCOL_CLIENT_STUB_IMPL_H_ + +#include "base/basictypes.h" +#include "base/ref_counted.h" +#include "remoting/protocol/client_stub.h" + +class Task; + +namespace net { +class Socket; +} // namespace net + +namespace remoting { +namespace protocol { + +class BufferedSocketWriter; + +class ClientControlSender : public ClientStub { + public: + // Create a stub using a socket. + explicit ClientControlSender(net::Socket* socket); + virtual ~ClientControlSender(); + + virtual void NotifyResolution(const NotifyResolutionRequest* msg, + Task* done); + private: + // Buffered socket writer holds the serialized message and send it on the + // right thread. + scoped_refptr<BufferedSocketWriter> buffered_writer_; + + DISALLOW_COPY_AND_ASSIGN(ClientControlSender); +}; + +} // namespace protocol +} // namespace remoting + +#endif // REMOTING_PROTOCOL_CLIENT_STUB_IMPL_H_ |