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 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
77 virtual ClientStub* client_stub(); | 77 virtual ClientStub* client_stub(); |
78 | 78 |
79 // These two setters should be called before Init(). | 79 // These two setters should be called before Init(). |
80 virtual void set_host_stub(HostStub* host_stub); | 80 virtual void set_host_stub(HostStub* host_stub); |
81 virtual void set_input_stub(InputStub* input_stub); | 81 virtual void set_input_stub(InputStub* input_stub); |
82 | 82 |
83 private: | 83 private: |
84 // Callback for protocol Session. | 84 // Callback for protocol Session. |
85 void OnSessionStateChange(Session::State state); | 85 void OnSessionStateChange(Session::State state); |
86 | 86 |
87 // Callback for VideoReader::Init(). | 87 // Callbacks for channel initialization. |
88 void OnVideoInitialized(bool successful); | 88 void OnControlChannelInitialized(bool successful); |
| 89 void OnEventChannelInitialized(bool successful); |
| 90 void OnVideoChannelInitialized(bool successful); |
89 | 91 |
90 void NotifyIfChannelsReady(); | 92 void NotifyIfChannelsReady(); |
91 | 93 |
92 void CloseOnError(); | 94 void CloseOnError(); |
93 | 95 |
94 // Stops writing in the channels. | 96 // Stops writing in the channels. |
95 void CloseChannels(); | 97 void CloseChannels(); |
96 | 98 |
97 // Event handler for handling events sent from this object. | 99 // Event handler for handling events sent from this object. |
98 EventHandler* handler_; | 100 EventHandler* handler_; |
99 | 101 |
100 // Stubs that are called for incoming messages. | 102 // Stubs that are called for incoming messages. |
101 HostStub* host_stub_; | 103 HostStub* host_stub_; |
102 InputStub* input_stub_; | 104 InputStub* input_stub_; |
103 | 105 |
104 // The libjingle channel used to send and receive data from the remote client. | 106 // The libjingle channel used to send and receive data from the remote client. |
105 scoped_ptr<Session> session_; | 107 scoped_ptr<Session> session_; |
106 | 108 |
| 109 scoped_ptr<HostControlDispatcher> control_dispatcher_; |
| 110 scoped_ptr<HostEventDispatcher> event_dispatcher_; |
107 scoped_ptr<VideoWriter> video_writer_; | 111 scoped_ptr<VideoWriter> video_writer_; |
108 scoped_ptr<HostControlDispatcher> control_dispatcher_; | |
109 scoped_ptr<HostEventDispatcher> input_dispatcher_; | |
110 | 112 |
111 // State of the channels. | 113 // State of the channels. |
112 bool control_connected_; | 114 bool control_channel_connected_; |
113 bool input_connected_; | 115 bool event_channel_connected_; |
114 bool video_connected_; | 116 bool video_channel_connected_; |
115 | 117 |
116 DISALLOW_COPY_AND_ASSIGN(ConnectionToClient); | 118 DISALLOW_COPY_AND_ASSIGN(ConnectionToClient); |
117 }; | 119 }; |
118 | 120 |
119 } // namespace protocol | 121 } // namespace protocol |
120 } // namespace remoting | 122 } // namespace remoting |
121 | 123 |
122 #endif // REMOTING_PROTOCOL_CONNECTION_TO_CLIENT_H_ | 124 #endif // REMOTING_PROTOCOL_CONNECTION_TO_CLIENT_H_ |
OLD | NEW |