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_HOST_H_ | 5 #ifndef REMOTING_PROTOCOL_CONNECTION_TO_HOST_H_ |
6 #define REMOTING_PROTOCOL_CONNECTION_TO_HOST_H_ | 6 #define REMOTING_PROTOCOL_CONNECTION_TO_HOST_H_ |
7 | 7 |
8 #include <set> | 8 #include <set> |
9 #include <string> | 9 #include <string> |
10 | 10 |
11 #include "base/callback_forward.h" | 11 #include "base/callback_forward.h" |
12 #include "base/memory/ref_counted.h" | 12 #include "base/memory/ref_counted.h" |
13 #include "base/memory/scoped_ptr.h" | 13 #include "base/memory/scoped_ptr.h" |
14 #include "base/threading/non_thread_safe.h" | 14 #include "base/threading/non_thread_safe.h" |
15 #include "base/timer/timer.h" | 15 #include "base/timer/timer.h" |
16 #include "remoting/proto/internal.pb.h" | 16 #include "remoting/proto/internal.pb.h" |
17 #include "remoting/protocol/clipboard_filter.h" | 17 #include "remoting/protocol/clipboard_filter.h" |
18 #include "remoting/protocol/errors.h" | 18 #include "remoting/protocol/errors.h" |
19 #include "remoting/protocol/input_filter.h" | 19 #include "remoting/protocol/input_filter.h" |
20 #include "remoting/protocol/message_reader.h" | 20 #include "remoting/protocol/message_reader.h" |
21 #include "remoting/protocol/monitored_video_stub.h" | 21 #include "remoting/protocol/monitored_video_stub.h" |
22 #include "remoting/protocol/session.h" | 22 #include "remoting/protocol/session.h" |
23 #include "remoting/protocol/session_config.h" | |
23 #include "remoting/protocol/session_manager.h" | 24 #include "remoting/protocol/session_manager.h" |
24 #include "remoting/signaling/signal_strategy.h" | 25 #include "remoting/signaling/signal_strategy.h" |
25 | 26 |
26 namespace remoting { | 27 namespace remoting { |
27 | 28 |
28 class XmppProxy; | 29 class XmppProxy; |
29 class VideoPacket; | 30 class VideoPacket; |
30 | 31 |
31 namespace protocol { | 32 namespace protocol { |
32 | 33 |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
76 virtual void OnConnectionReady(bool ready) = 0; | 77 virtual void OnConnectionReady(bool ready) = 0; |
77 | 78 |
78 // Called when the route type (direct vs. STUN vs. proxied) changes. | 79 // Called when the route type (direct vs. STUN vs. proxied) changes. |
79 virtual void OnRouteChanged(const std::string& channel_name, | 80 virtual void OnRouteChanged(const std::string& channel_name, |
80 const protocol::TransportRoute& route) = 0; | 81 const protocol::TransportRoute& route) = 0; |
81 }; | 82 }; |
82 | 83 |
83 ConnectionToHost(); | 84 ConnectionToHost(); |
84 virtual ~ConnectionToHost(); | 85 virtual ~ConnectionToHost(); |
85 | 86 |
87 // Allows to set a custom protocol configuration (e.g. for tests). Cannot be | |
88 // called after Connect(). | |
89 void set_candidate_config(scoped_ptr<CandidateSessionConfig> config); | |
rmsousa
2014/07/16 23:06:00
nit, feel free to ignore:
this name (and the corre
Sergey Ulanov
2014/07/17 01:47:58
Yeah I agree, that it might be confusing, but set_
| |
90 | |
86 // Set the stubs which will handle messages from the host. | 91 // Set the stubs which will handle messages from the host. |
87 // The caller must ensure that stubs out-live the connection. | 92 // The caller must ensure that stubs out-live the connection. |
88 // Unless otherwise specified, all stubs must be set before Connect() | 93 // Unless otherwise specified, all stubs must be set before Connect() |
89 // is called. | 94 // is called. |
90 void set_client_stub(ClientStub* client_stub); | 95 void set_client_stub(ClientStub* client_stub); |
91 void set_clipboard_stub(ClipboardStub* clipboard_stub); | 96 void set_clipboard_stub(ClipboardStub* clipboard_stub); |
92 void set_video_stub(VideoStub* video_stub); | 97 void set_video_stub(VideoStub* video_stub); |
93 // If no audio stub is specified then audio will not be requested. | 98 // If no audio stub is specified then audio will not be requested. |
94 void set_audio_stub(AudioStub* audio_stub); | 99 void set_audio_stub(AudioStub* audio_stub); |
95 | 100 |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
149 void CloseChannels(); | 154 void CloseChannels(); |
150 | 155 |
151 void SetState(State state, ErrorCode error); | 156 void SetState(State state, ErrorCode error); |
152 | 157 |
153 std::string host_jid_; | 158 std::string host_jid_; |
154 std::string host_public_key_; | 159 std::string host_public_key_; |
155 scoped_ptr<Authenticator> authenticator_; | 160 scoped_ptr<Authenticator> authenticator_; |
156 | 161 |
157 HostEventCallback* event_callback_; | 162 HostEventCallback* event_callback_; |
158 | 163 |
164 scoped_ptr<CandidateSessionConfig> candidate_config_; | |
165 | |
159 // Stub for incoming messages. | 166 // Stub for incoming messages. |
160 ClientStub* client_stub_; | 167 ClientStub* client_stub_; |
161 ClipboardStub* clipboard_stub_; | 168 ClipboardStub* clipboard_stub_; |
162 AudioStub* audio_stub_; | 169 AudioStub* audio_stub_; |
163 | 170 |
164 SignalStrategy* signal_strategy_; | 171 SignalStrategy* signal_strategy_; |
165 scoped_ptr<SessionManager> session_manager_; | 172 scoped_ptr<SessionManager> session_manager_; |
166 scoped_ptr<Session> session_; | 173 scoped_ptr<Session> session_; |
167 scoped_ptr<MonitoredVideoStub> monitored_video_stub_; | 174 scoped_ptr<MonitoredVideoStub> monitored_video_stub_; |
168 | 175 |
169 scoped_ptr<VideoReader> video_reader_; | 176 scoped_ptr<VideoReader> video_reader_; |
170 scoped_ptr<AudioReader> audio_reader_; | 177 scoped_ptr<AudioReader> audio_reader_; |
171 scoped_ptr<ClientControlDispatcher> control_dispatcher_; | 178 scoped_ptr<ClientControlDispatcher> control_dispatcher_; |
172 scoped_ptr<ClientEventDispatcher> event_dispatcher_; | 179 scoped_ptr<ClientEventDispatcher> event_dispatcher_; |
173 ClipboardFilter clipboard_forwarder_; | 180 ClipboardFilter clipboard_forwarder_; |
174 InputFilter event_forwarder_; | 181 InputFilter event_forwarder_; |
175 | 182 |
176 // Internal state of the connection. | 183 // Internal state of the connection. |
177 State state_; | 184 State state_; |
178 ErrorCode error_; | 185 ErrorCode error_; |
179 | 186 |
180 private: | 187 private: |
181 DISALLOW_COPY_AND_ASSIGN(ConnectionToHost); | 188 DISALLOW_COPY_AND_ASSIGN(ConnectionToHost); |
182 }; | 189 }; |
183 | 190 |
184 } // namespace protocol | 191 } // namespace protocol |
185 } // namespace remoting | 192 } // namespace remoting |
186 | 193 |
187 #endif // REMOTING_PROTOCOL_CONNECTION_TO_HOST_H_ | 194 #endif // REMOTING_PROTOCOL_CONNECTION_TO_HOST_H_ |
OLD | NEW |