Index: remoting/protocol/host_control_dispatcher.h |
diff --git a/remoting/protocol/host_control_dispatcher.h b/remoting/protocol/host_control_dispatcher.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..b1bf67f0184227c3e74690655589aec3a1cb6677 |
--- /dev/null |
+++ b/remoting/protocol/host_control_dispatcher.h |
@@ -0,0 +1,55 @@ |
+// Copyright (c) 2011 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. |
+ |
+#ifndef REMOTING_PROTOCOL_HOST_CONTROL_DISPATCHER_H_ |
+#define REMOTING_PROTOCOL_HOST_CONTROL_DISPATCHER_H_ |
+ |
+#include "base/basictypes.h" |
+#include "base/memory/ref_counted.h" |
+#include "remoting/protocol/client_stub.h" |
+#include "remoting/protocol/message_reader.h" |
+ |
+namespace base { |
+class MessageLoopProxy; |
+} // namespace base |
+ |
+namespace remoting { |
+namespace protocol { |
+ |
+class BufferedSocketWriter; |
+class ControlMessage; |
+class HostStub; |
+class Session; |
+ |
+// HostControlDispatcher manages control channel on the host side. It |
+// dispatches incoming messages on the control channel to HostStub, |
+// and also implements ClientStub for outgoing messages. |
+class HostControlDispatcher : public ClientStub { |
+ public: |
+ explicit HostControlDispatcher(base::MessageLoopProxy* message_loop); |
Wez
2011/11/17 02:03:40
What is message_loop used for?
Sergey Ulanov
2011/11/17 18:38:14
Removed it - we don't really need it because it al
|
+ virtual ~HostControlDispatcher(); |
+ |
+ void Init(Session* session, HostStub* host_stub); |
Wez
2011/11/17 02:03:40
How are session & host_stub used, and who owns the
Sergey Ulanov
2011/11/17 18:38:14
Done.
|
+ |
+ // Stop writing. Must be called on the network thread when the |
+ // underlying socket is being destroyed. |
+ void Close(); |
Wez
2011/11/17 02:03:40
Calling code doesn't seem to use this - it just de
Sergey Ulanov
2011/11/17 18:38:14
Done. Also in HostInputDispatcher.
|
+ |
+ private: |
+ // This method is called by |reader_| when a message is received. |
+ void OnMessageReceived(ControlMessage* message, |
+ const base::Closure& done_task); |
+ |
+ HostStub* host_stub_; |
+ |
+ ProtobufMessageReader<ControlMessage> reader_; |
+ scoped_refptr<BufferedSocketWriter> writer_; |
+ |
+ DISALLOW_COPY_AND_ASSIGN(HostControlDispatcher); |
+}; |
+ |
+} // namespace protocol |
+} // namespace remoting |
+ |
+#endif // REMOTING_PROTOCOL_HOST_CONTROL_DISPATCHER_H_ |