OLD | NEW |
---|---|
(Empty) | |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef REMOTING_PROTOCOL_HOST_CONTROL_DISPATCHER_H_ | |
6 #define REMOTING_PROTOCOL_HOST_CONTROL_DISPATCHER_H_ | |
7 | |
8 #include "base/basictypes.h" | |
9 #include "base/memory/ref_counted.h" | |
10 #include "remoting/protocol/client_stub.h" | |
11 #include "remoting/protocol/message_reader.h" | |
12 | |
13 namespace base { | |
14 class MessageLoopProxy; | |
15 } // namespace base | |
16 | |
17 namespace remoting { | |
18 namespace protocol { | |
19 | |
20 class BufferedSocketWriter; | |
21 class ControlMessage; | |
22 class HostStub; | |
23 class Session; | |
24 | |
25 // HostControlDispatcher manages control channel on the host side. It | |
26 // dispatches incoming messages on the control channel to HostStub, | |
27 // and also implements ClientStub for outgoing messages. | |
28 class HostControlDispatcher : public ClientStub { | |
29 public: | |
30 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
| |
31 virtual ~HostControlDispatcher(); | |
32 | |
33 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.
| |
34 | |
35 // Stop writing. Must be called on the network thread when the | |
36 // underlying socket is being destroyed. | |
37 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.
| |
38 | |
39 private: | |
40 // This method is called by |reader_| when a message is received. | |
41 void OnMessageReceived(ControlMessage* message, | |
42 const base::Closure& done_task); | |
43 | |
44 HostStub* host_stub_; | |
45 | |
46 ProtobufMessageReader<ControlMessage> reader_; | |
47 scoped_refptr<BufferedSocketWriter> writer_; | |
48 | |
49 DISALLOW_COPY_AND_ASSIGN(HostControlDispatcher); | |
50 }; | |
51 | |
52 } // namespace protocol | |
53 } // namespace remoting | |
54 | |
55 #endif // REMOTING_PROTOCOL_HOST_CONTROL_DISPATCHER_H_ | |
OLD | NEW |