OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef REMOTING_PROTOCOL_HOST_MESSAGE_DISPATCHER_H_ | 5 #ifndef REMOTING_PROTOCOL_HOST_MESSAGE_DISPATCHER_H_ |
6 #define REMOTING_PROTOCOL_HOST_MESSAGE_DISPATCHER_H_ | 6 #define REMOTING_PROTOCOL_HOST_MESSAGE_DISPATCHER_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "base/task.h" | 10 #include "base/task.h" |
(...skipping 30 matching lines...) Expand all Loading... |
41 virtual ~HostMessageDispatcher(); | 41 virtual ~HostMessageDispatcher(); |
42 | 42 |
43 // Initialize the message dispatcher with the given connection and | 43 // Initialize the message dispatcher with the given connection and |
44 // message handlers. | 44 // message handlers. |
45 void Initialize(ConnectionToClient* connection, | 45 void Initialize(ConnectionToClient* connection, |
46 HostStub* host_stub, InputStub* input_stub); | 46 HostStub* host_stub, InputStub* input_stub); |
47 | 47 |
48 private: | 48 private: |
49 // This method is called by |control_channel_reader_| when a control | 49 // This method is called by |control_channel_reader_| when a control |
50 // message is received. | 50 // message is received. |
51 void OnControlMessageReceived(ControlMessage* message, Task* done_task); | 51 void OnControlMessageReceived(ControlMessage* message, |
| 52 const base::Closure& done_task); |
52 | 53 |
53 // This method is called by |event_channel_reader_| when a event | 54 // This method is called by |event_channel_reader_| when a event |
54 // message is received. | 55 // message is received. |
55 void OnEventMessageReceived(EventMessage* message, Task* done_task); | 56 void OnEventMessageReceived(EventMessage* message, |
| 57 const base::Closure& done_task); |
56 | 58 |
57 // MessageReader that runs on the control channel. It runs a loop | 59 // MessageReader that runs on the control channel. It runs a loop |
58 // that parses data on the channel and then delegates the message to this | 60 // that parses data on the channel and then delegates the message to this |
59 // class. | 61 // class. |
60 scoped_ptr<ProtobufMessageReader<ControlMessage> > control_message_reader_; | 62 scoped_ptr<ProtobufMessageReader<ControlMessage> > control_message_reader_; |
61 | 63 |
62 // MessageReader that runs on the event channel. | 64 // MessageReader that runs on the event channel. |
63 scoped_ptr<ProtobufMessageReader<EventMessage> > event_message_reader_; | 65 scoped_ptr<ProtobufMessageReader<EventMessage> > event_message_reader_; |
64 | 66 |
65 // Connection that this object belongs to. | 67 // Connection that this object belongs to. |
66 ConnectionToClient* connection_; | 68 ConnectionToClient* connection_; |
67 | 69 |
68 // Stubs for host and input. These objects are not owned. | 70 // Stubs for host and input. These objects are not owned. |
69 // They are called on the thread there data is received, i.e. jingle thread. | 71 // They are called on the thread there data is received, i.e. jingle thread. |
70 HostStub* host_stub_; | 72 HostStub* host_stub_; |
71 InputStub* input_stub_; | 73 InputStub* input_stub_; |
72 }; | 74 }; |
73 | 75 |
74 } // namespace protocol | 76 } // namespace protocol |
75 } // namespace remoting | 77 } // namespace remoting |
76 | 78 |
77 #endif // REMOTING_PROTOCOL_HOST_MESSAGE_DISPATCHER_H_ | 79 #endif // REMOTING_PROTOCOL_HOST_MESSAGE_DISPATCHER_H_ |
OLD | NEW |