Chromium Code Reviews| 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_CLIENT_CONTROL_DISPATCHER_H_ | |
| 6 #define REMOTING_PROTOCOL_CLIENT_CONTROL_DISPATCHER_H_ | |
| 7 | |
| 8 #include "base/basictypes.h" | |
| 9 #include "base/memory/ref_counted.h" | |
| 10 #include "remoting/protocol/host_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 ClientStub; | |
| 21 class ControlMessage; | |
| 22 class BufferedSocketWriter; | |
| 23 class Session; | |
| 24 | |
| 25 // ClientControlDispatcher manages control channel on the client | |
|
Wez
2011/11/17 01:51:56
typo: manages _the_ control channel
Although I th
Sergey Ulanov
2011/11/17 19:29:06
Done.
| |
| 26 // side. It dispatches incoming messages on the control channel to | |
| 27 // ClientStub, and also implements HostStub for outgoing messages. | |
|
Wez
2011/11/17 01:51:56
I think perhaps ClientStub and HostStub need renam
Sergey Ulanov
2011/11/17 19:29:06
Agree. Any suggestions for new names?
| |
| 28 class ClientControlDispatcher : public HostStub { | |
| 29 public: | |
| 30 // Construct a message dispatcher. | |
|
Wez
2011/11/17 01:51:56
What is the |message_loop| parameter used for?
Sergey Ulanov
2011/11/17 19:29:06
Removed this comment and |message_loop|
| |
| 31 ClientControlDispatcher(base::MessageLoopProxy* message_loop); | |
|
Wez
2011/11/17 01:51:56
Why is the |message_loop| supplied to the ctor, ra
Wez
2011/11/17 01:51:56
Missing explicit here.
Sergey Ulanov
2011/11/17 19:29:06
Done.
Sergey Ulanov
2011/11/17 19:29:06
not needed anymore
| |
| 32 virtual ~ClientControlDispatcher(); | |
| 33 | |
| 34 // Initialize the message dispatcher with the given connection and | |
| 35 // message handlers. | |
|
Wez
2011/11/17 01:51:56
Who owns them?
Sergey Ulanov
2011/11/17 19:29:06
Done.
| |
| 36 void Init(protocol::Session* session, ClientStub* client_stub); | |
| 37 | |
| 38 void Close(); | |
|
Wez
2011/11/17 01:51:56
What does this do? Who uses it?
Sergey Ulanov
2011/11/17 19:29:06
Done.
| |
| 39 | |
| 40 private: | |
| 41 void OnMessageReceived(ControlMessage* message, | |
| 42 const base::Closure& done_task); | |
| 43 | |
| 44 ClientStub* client_stub_; | |
| 45 | |
| 46 ProtobufMessageReader<ControlMessage> reader_; | |
| 47 scoped_refptr<BufferedSocketWriter> writer_; | |
| 48 | |
| 49 DISALLOW_COPY_AND_ASSIGN(ClientControlDispatcher); | |
| 50 }; | |
| 51 | |
| 52 } // namespace protocol | |
| 53 } // namespace remoting | |
| 54 | |
| 55 #endif // REMOTING_PROTOCOL_CLIENT_CONTROL_DISPATCHER_H_ | |
| OLD | NEW |