| 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_CONNECTION_TO_CLIENT_H_ | 5 #ifndef REMOTING_PROTOCOL_CONNECTION_TO_CLIENT_H_ |
| 6 #define REMOTING_PROTOCOL_CONNECTION_TO_CLIENT_H_ | 6 #define REMOTING_PROTOCOL_CONNECTION_TO_CLIENT_H_ |
| 7 | 7 |
| 8 #include <deque> | 8 #include <deque> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| 11 #include "base/memory/scoped_ptr.h" | 11 #include "base/memory/scoped_ptr.h" |
| 12 #include "base/synchronization/lock.h" | 12 #include "base/synchronization/lock.h" |
| 13 #include "base/threading/non_thread_safe.h" | 13 #include "base/threading/non_thread_safe.h" |
| 14 #include "remoting/protocol/session.h" | 14 #include "remoting/protocol/session.h" |
| 15 #include "remoting/protocol/video_writer.h" | 15 #include "remoting/protocol/video_writer.h" |
| 16 | 16 |
| 17 namespace base { | 17 namespace base { |
| 18 class MessageLoopProxy; | 18 class MessageLoopProxy; |
| 19 } // namespace base | 19 } // namespace base |
| 20 | 20 |
| 21 namespace remoting { | 21 namespace remoting { |
| 22 namespace protocol { | 22 namespace protocol { |
| 23 | 23 |
| 24 class ClientControlSender; | |
| 25 class ClientStub; | 24 class ClientStub; |
| 26 class HostStub; | 25 class HostStub; |
| 27 class InputStub; | 26 class InputStub; |
| 28 class HostMessageDispatcher; | 27 class HostControlDispatcher; |
| 28 class HostEventDispatcher; |
| 29 | 29 |
| 30 // This class represents a remote viewer connection to the chromoting | 30 // This class represents a remote viewer connection to the chromoting |
| 31 // host. It sets up all protocol channels and connects them to the | 31 // host. It sets up all protocol channels and connects them to the |
| 32 // stubs. | 32 // stubs. |
| 33 class ConnectionToClient : public base::NonThreadSafe { | 33 class ConnectionToClient : public base::NonThreadSafe { |
| 34 public: | 34 public: |
| 35 class EventHandler { | 35 class EventHandler { |
| 36 public: | 36 public: |
| 37 virtual ~EventHandler() {} | 37 virtual ~EventHandler() {} |
| 38 | 38 |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 97 // Event handler for handling events sent from this object. | 97 // Event handler for handling events sent from this object. |
| 98 EventHandler* handler_; | 98 EventHandler* handler_; |
| 99 | 99 |
| 100 // Stubs that are called for incoming messages. | 100 // Stubs that are called for incoming messages. |
| 101 HostStub* host_stub_; | 101 HostStub* host_stub_; |
| 102 InputStub* input_stub_; | 102 InputStub* input_stub_; |
| 103 | 103 |
| 104 // The libjingle channel used to send and receive data from the remote client. | 104 // The libjingle channel used to send and receive data from the remote client. |
| 105 scoped_ptr<Session> session_; | 105 scoped_ptr<Session> session_; |
| 106 | 106 |
| 107 // Writers for outgoing channels. | |
| 108 scoped_ptr<VideoWriter> video_writer_; | 107 scoped_ptr<VideoWriter> video_writer_; |
| 109 scoped_ptr<ClientControlSender> client_control_sender_; | 108 scoped_ptr<HostControlDispatcher> control_dispatcher_; |
| 110 | 109 scoped_ptr<HostEventDispatcher> input_dispatcher_; |
| 111 // Dispatcher for incoming messages. | |
| 112 scoped_ptr<HostMessageDispatcher> dispatcher_; | |
| 113 | 110 |
| 114 // State of the channels. | 111 // State of the channels. |
| 115 bool control_connected_; | 112 bool control_connected_; |
| 116 bool input_connected_; | 113 bool input_connected_; |
| 117 bool video_connected_; | 114 bool video_connected_; |
| 118 | 115 |
| 119 DISALLOW_COPY_AND_ASSIGN(ConnectionToClient); | 116 DISALLOW_COPY_AND_ASSIGN(ConnectionToClient); |
| 120 }; | 117 }; |
| 121 | 118 |
| 122 } // namespace protocol | 119 } // namespace protocol |
| 123 } // namespace remoting | 120 } // namespace remoting |
| 124 | 121 |
| 125 #endif // REMOTING_PROTOCOL_CONNECTION_TO_CLIENT_H_ | 122 #endif // REMOTING_PROTOCOL_CONNECTION_TO_CLIENT_H_ |
| OLD | NEW |