| 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 |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 83 virtual void set_input_stub(InputStub* input_stub); | 83 virtual void set_input_stub(InputStub* input_stub); |
| 84 | 84 |
| 85 protected: | 85 protected: |
| 86 friend class base::RefCountedThreadSafe<ConnectionToClient>; | 86 friend class base::RefCountedThreadSafe<ConnectionToClient>; |
| 87 virtual ~ConnectionToClient(); | 87 virtual ~ConnectionToClient(); |
| 88 | 88 |
| 89 private: | 89 private: |
| 90 // Callback for protocol Session. | 90 // Callback for protocol Session. |
| 91 void OnSessionStateChange(Session::State state); | 91 void OnSessionStateChange(Session::State state); |
| 92 | 92 |
| 93 // Callback for VideoReader::Init(). |
| 94 void OnVideoInitialized(bool successful); |
| 95 |
| 96 void NotifyIfChannelsReady(); |
| 97 |
| 98 void CloseOnError(); |
| 99 |
| 93 // Stops writing in the channels. | 100 // Stops writing in the channels. |
| 94 void CloseChannels(); | 101 void CloseChannels(); |
| 95 | 102 |
| 96 // The libjingle channel used to send and receive data from the remote client. | |
| 97 scoped_ptr<Session> session_; | |
| 98 | |
| 99 scoped_ptr<VideoWriter> video_writer_; | |
| 100 | |
| 101 // ClientStub for sending messages to the client. | |
| 102 scoped_ptr<ClientControlSender> client_control_sender_; | |
| 103 | |
| 104 // The message loop that this object runs on. | 103 // The message loop that this object runs on. |
| 105 MessageLoop* loop_; | 104 MessageLoop* loop_; |
| 106 | 105 |
| 107 // Event handler for handling events sent from this object. | 106 // Event handler for handling events sent from this object. |
| 108 EventHandler* handler_; | 107 EventHandler* handler_; |
| 109 | 108 |
| 110 // HostStub for receiving control events from the client. | 109 // Stubs that are called for incoming messages. |
| 111 HostStub* host_stub_; | 110 HostStub* host_stub_; |
| 112 | |
| 113 // InputStub for receiving input events from the client. | |
| 114 InputStub* input_stub_; | 111 InputStub* input_stub_; |
| 115 | 112 |
| 116 // Dispatcher for submitting messages to stubs. | 113 // The libjingle channel used to send and receive data from the remote client. |
| 114 scoped_ptr<Session> session_; |
| 115 |
| 116 // Writers for outgoing channels. |
| 117 scoped_ptr<VideoWriter> video_writer_; |
| 118 scoped_ptr<ClientControlSender> client_control_sender_; |
| 119 |
| 120 // Dispatcher for incoming messages. |
| 117 scoped_ptr<HostMessageDispatcher> dispatcher_; | 121 scoped_ptr<HostMessageDispatcher> dispatcher_; |
| 118 | 122 |
| 123 // State of the channels. |
| 124 bool control_connected_; |
| 125 bool input_connected_; |
| 126 bool video_connected_; |
| 127 |
| 119 DISALLOW_COPY_AND_ASSIGN(ConnectionToClient); | 128 DISALLOW_COPY_AND_ASSIGN(ConnectionToClient); |
| 120 }; | 129 }; |
| 121 | 130 |
| 122 } // namespace protocol | 131 } // namespace protocol |
| 123 } // namespace remoting | 132 } // namespace remoting |
| 124 | 133 |
| 125 #endif // REMOTING_PROTOCOL_CONNECTION_TO_CLIENT_H_ | 134 #endif // REMOTING_PROTOCOL_CONNECTION_TO_CLIENT_H_ |
| OLD | NEW |