OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_CONTROL_DISPATCHER_H_ | 5 #ifndef REMOTING_PROTOCOL_HOST_CONTROL_DISPATCHER_H_ |
6 #define REMOTING_PROTOCOL_HOST_CONTROL_DISPATCHER_H_ | 6 #define REMOTING_PROTOCOL_HOST_CONTROL_DISPATCHER_H_ |
7 | 7 |
8 #include "base/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
9 #include "remoting/protocol/channel_dispatcher_base.h" | 9 #include "remoting/protocol/channel_dispatcher_base.h" |
10 #include "remoting/protocol/client_stub.h" | 10 #include "remoting/protocol/client_stub.h" |
(...skipping 30 matching lines...) Expand all Loading... |
41 // Sets HostStub that will be called for each incoming control | 41 // Sets HostStub that will be called for each incoming control |
42 // message. Doesn't take ownership of |host_stub|. It must outlive | 42 // message. Doesn't take ownership of |host_stub|. It must outlive |
43 // this dispatcher. | 43 // this dispatcher. |
44 void set_host_stub(HostStub* host_stub) { host_stub_ = host_stub; } | 44 void set_host_stub(HostStub* host_stub) { host_stub_ = host_stub; } |
45 | 45 |
46 protected: | 46 protected: |
47 // ChannelDispatcherBase overrides. | 47 // ChannelDispatcherBase overrides. |
48 virtual void OnInitialized() OVERRIDE; | 48 virtual void OnInitialized() OVERRIDE; |
49 | 49 |
50 private: | 50 private: |
51 void OnMessageReceived(ControlMessage* message, | 51 void OnMessageReceived(scoped_ptr<ControlMessage> message, |
52 const base::Closure& done_task); | 52 const base::Closure& done_task); |
53 | 53 |
54 ClipboardStub* clipboard_stub_; | 54 ClipboardStub* clipboard_stub_; |
55 HostStub* host_stub_; | 55 HostStub* host_stub_; |
56 | 56 |
57 ProtobufMessageReader<ControlMessage> reader_; | 57 ProtobufMessageReader<ControlMessage> reader_; |
58 scoped_refptr<BufferedSocketWriter> writer_; | 58 scoped_refptr<BufferedSocketWriter> writer_; |
59 | 59 |
60 DISALLOW_COPY_AND_ASSIGN(HostControlDispatcher); | 60 DISALLOW_COPY_AND_ASSIGN(HostControlDispatcher); |
61 }; | 61 }; |
62 | 62 |
63 } // namespace protocol | 63 } // namespace protocol |
64 } // namespace remoting | 64 } // namespace remoting |
65 | 65 |
66 #endif // REMOTING_PROTOCOL_HOST_CONTROL_DISPATCHER_H_ | 66 #endif // REMOTING_PROTOCOL_HOST_CONTROL_DISPATCHER_H_ |
OLD | NEW |