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_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 <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
85 virtual void OnEventTimestamp(int64 timestamp); | 85 virtual void OnEventTimestamp(int64 timestamp); |
86 | 86 |
87 // Get the stubs used by the host to transmit messages to the client. | 87 // Get the stubs used by the host to transmit messages to the client. |
88 // The stubs must not be accessed before OnConnectionAuthenticated(), or | 88 // The stubs must not be accessed before OnConnectionAuthenticated(), or |
89 // after OnConnectionClosed(). | 89 // after OnConnectionClosed(). |
90 // Note that the audio stub will be nullptr if audio is not enabled. | 90 // Note that the audio stub will be nullptr if audio is not enabled. |
91 virtual VideoStub* video_stub(); | 91 virtual VideoStub* video_stub(); |
92 virtual AudioStub* audio_stub(); | 92 virtual AudioStub* audio_stub(); |
93 virtual ClientStub* client_stub(); | 93 virtual ClientStub* client_stub(); |
94 | 94 |
95 // Set/get the stubs which will handle messages we receive from the client. | 95 // Set/get the stubs which will handle messages we receive from the client. |
Wez
2015/02/07 00:40:43
These methods only set, not get
Sergey Ulanov
2015/02/13 19:40:21
Done.
| |
96 // All stubs MUST be set before the session's channels become connected. | 96 // These stubs must be set in EventHandler::OnConnectionAuthenticated(). |
Wez
2015/02/07 00:40:43
These must be called from ... ?
Sergey Ulanov
2015/02/13 19:40:21
Done.
| |
97 virtual void set_clipboard_stub(ClipboardStub* clipboard_stub); | 97 virtual void set_clipboard_stub(ClipboardStub* clipboard_stub); |
98 virtual ClipboardStub* clipboard_stub(); | |
99 virtual void set_host_stub(HostStub* host_stub); | 98 virtual void set_host_stub(HostStub* host_stub); |
100 virtual HostStub* host_stub(); | |
101 virtual void set_input_stub(InputStub* input_stub); | 99 virtual void set_input_stub(InputStub* input_stub); |
102 virtual InputStub* input_stub(); | |
103 | 100 |
104 // Session::EventHandler interface. | 101 // Session::EventHandler interface. |
105 void OnSessionStateChange(Session::State state) override; | 102 void OnSessionStateChange(Session::State state) override; |
106 void OnSessionRouteChange(const std::string& channel_name, | 103 void OnSessionRouteChange(const std::string& channel_name, |
107 const TransportRoute& route) override; | 104 const TransportRoute& route) override; |
108 | 105 |
109 // ChannelDispatcherBase::EventHandler interface. | 106 // ChannelDispatcherBase::EventHandler interface. |
110 void OnChannelInitialized(ChannelDispatcherBase* channel_dispatcher) override; | 107 void OnChannelInitialized(ChannelDispatcherBase* channel_dispatcher) override; |
111 void OnChannelError(ChannelDispatcherBase* channel_dispatcher, | 108 void OnChannelError(ChannelDispatcherBase* channel_dispatcher, |
112 ErrorCode error) override; | 109 ErrorCode error) override; |
113 | 110 |
114 private: | 111 private: |
115 void NotifyIfChannelsReady(); | 112 void NotifyIfChannelsReady(); |
116 | 113 |
117 void Close(ErrorCode error); | 114 void Close(ErrorCode error); |
118 | 115 |
119 // Stops writing in the channels. | 116 // Stops writing in the channels. |
120 void CloseChannels(); | 117 void CloseChannels(); |
121 | 118 |
122 // Event handler for handling events sent from this object. | 119 // Event handler for handling events sent from this object. |
123 EventHandler* handler_; | 120 EventHandler* handler_; |
124 | 121 |
125 // Stubs that are called for incoming messages. | |
126 ClipboardStub* clipboard_stub_; | |
127 HostStub* host_stub_; | |
128 InputStub* input_stub_; | |
129 | |
130 // The libjingle channel used to send and receive data from the remote client. | 122 // The libjingle channel used to send and receive data from the remote client. |
131 scoped_ptr<Session> session_; | 123 scoped_ptr<Session> session_; |
132 | 124 |
133 scoped_ptr<HostControlDispatcher> control_dispatcher_; | 125 scoped_ptr<HostControlDispatcher> control_dispatcher_; |
134 scoped_ptr<HostEventDispatcher> event_dispatcher_; | 126 scoped_ptr<HostEventDispatcher> event_dispatcher_; |
135 scoped_ptr<HostVideoDispatcher> video_dispatcher_; | 127 scoped_ptr<HostVideoDispatcher> video_dispatcher_; |
136 scoped_ptr<AudioWriter> audio_writer_; | 128 scoped_ptr<AudioWriter> audio_writer_; |
137 | 129 |
138 DISALLOW_COPY_AND_ASSIGN(ConnectionToClient); | 130 DISALLOW_COPY_AND_ASSIGN(ConnectionToClient); |
139 }; | 131 }; |
140 | 132 |
141 } // namespace protocol | 133 } // namespace protocol |
142 } // namespace remoting | 134 } // namespace remoting |
143 | 135 |
144 #endif // REMOTING_PROTOCOL_CONNECTION_TO_CLIENT_H_ | 136 #endif // REMOTING_PROTOCOL_CONNECTION_TO_CLIENT_H_ |
OLD | NEW |