| 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 #include "remoting/host/client_session.h" | 5 #include "remoting/host/client_session.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 75 extension_manager_.reset(new HostExtensionSessionManager(extensions, this)); | 75 extension_manager_.reset(new HostExtensionSessionManager(extensions, this)); |
| 76 | 76 |
| 77 #if defined(OS_WIN) | 77 #if defined(OS_WIN) |
| 78 // LocalInputMonitorWin filters out an echo of the injected input before it | 78 // LocalInputMonitorWin filters out an echo of the injected input before it |
| 79 // reaches |remote_input_filter_|. | 79 // reaches |remote_input_filter_|. |
| 80 remote_input_filter_.SetExpectLocalEcho(false); | 80 remote_input_filter_.SetExpectLocalEcho(false); |
| 81 #endif // defined(OS_WIN) | 81 #endif // defined(OS_WIN) |
| 82 } | 82 } |
| 83 | 83 |
| 84 ClientSession::~ClientSession() { | 84 ClientSession::~ClientSession() { |
| 85 DCHECK(CalledOnValidThread()); | 85 DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); |
| 86 DCHECK(!audio_stream_); | 86 DCHECK(!audio_stream_); |
| 87 DCHECK(!desktop_environment_); | 87 DCHECK(!desktop_environment_); |
| 88 DCHECK(!input_injector_); | 88 DCHECK(!input_injector_); |
| 89 DCHECK(!screen_controls_); | 89 DCHECK(!screen_controls_); |
| 90 DCHECK(!video_stream_); | 90 DCHECK(!video_stream_); |
| 91 | 91 |
| 92 connection_.reset(); | 92 connection_.reset(); |
| 93 } | 93 } |
| 94 | 94 |
| 95 void ClientSession::NotifyClientResolution( | 95 void ClientSession::NotifyClientResolution( |
| 96 const protocol::ClientResolution& resolution) { | 96 const protocol::ClientResolution& resolution) { |
| 97 DCHECK(CalledOnValidThread()); | 97 DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); |
| 98 DCHECK(resolution.dips_width() > 0 && resolution.dips_height() > 0); | 98 DCHECK(resolution.dips_width() > 0 && resolution.dips_height() > 0); |
| 99 | 99 |
| 100 VLOG(1) << "Received ClientResolution (dips_width=" | 100 VLOG(1) << "Received ClientResolution (dips_width=" |
| 101 << resolution.dips_width() << ", dips_height=" | 101 << resolution.dips_width() << ", dips_height=" |
| 102 << resolution.dips_height() << ")"; | 102 << resolution.dips_height() << ")"; |
| 103 | 103 |
| 104 if (!screen_controls_) | 104 if (!screen_controls_) |
| 105 return; | 105 return; |
| 106 | 106 |
| 107 webrtc::DesktopSize client_size(resolution.dips_width(), | 107 webrtc::DesktopSize client_size(resolution.dips_width(), |
| 108 resolution.dips_height()); | 108 resolution.dips_height()); |
| 109 if (connection_->session()->config().protocol() == | 109 if (connection_->session()->config().protocol() == |
| 110 protocol::SessionConfig::Protocol::WEBRTC) { | 110 protocol::SessionConfig::Protocol::WEBRTC) { |
| 111 // When using WebRTC round down the dimensions to multiple of 2. Otherwise | 111 // When using WebRTC round down the dimensions to multiple of 2. Otherwise |
| 112 // the dimensions will be rounded on the receiver, which will cause blurring | 112 // the dimensions will be rounded on the receiver, which will cause blurring |
| 113 // due to scaling. The resulting size is still close to the client size and | 113 // due to scaling. The resulting size is still close to the client size and |
| 114 // will fit on the client's screen without scaling. | 114 // will fit on the client's screen without scaling. |
| 115 // TODO(sergeyu): Make WebRTC handle odd dimensions properly. | 115 // TODO(sergeyu): Make WebRTC handle odd dimensions properly. |
| 116 // crbug.com/636071 | 116 // crbug.com/636071 |
| 117 client_size.set(client_size.width() & (~1), client_size.height() & (~1)); | 117 client_size.set(client_size.width() & (~1), client_size.height() & (~1)); |
| 118 } | 118 } |
| 119 | 119 |
| 120 // Try to match the client's resolution. | 120 // Try to match the client's resolution. |
| 121 // TODO(sergeyu): Pass clients DPI to the resizer. | 121 // TODO(sergeyu): Pass clients DPI to the resizer. |
| 122 screen_controls_->SetScreenResolution(ScreenResolution( | 122 screen_controls_->SetScreenResolution(ScreenResolution( |
| 123 client_size, webrtc::DesktopVector(kDefaultDpi, kDefaultDpi))); | 123 client_size, webrtc::DesktopVector(kDefaultDpi, kDefaultDpi))); |
| 124 } | 124 } |
| 125 | 125 |
| 126 void ClientSession::ControlVideo(const protocol::VideoControl& video_control) { | 126 void ClientSession::ControlVideo(const protocol::VideoControl& video_control) { |
| 127 DCHECK(CalledOnValidThread()); | 127 DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); |
| 128 | 128 |
| 129 // Note that |video_stream_| may be null, depending upon whether | 129 // Note that |video_stream_| may be null, depending upon whether |
| 130 // extensions choose to wrap or "steal" the video capturer or encoder. | 130 // extensions choose to wrap or "steal" the video capturer or encoder. |
| 131 if (video_control.has_enable()) { | 131 if (video_control.has_enable()) { |
| 132 VLOG(1) << "Received VideoControl (enable=" | 132 VLOG(1) << "Received VideoControl (enable=" |
| 133 << video_control.enable() << ")"; | 133 << video_control.enable() << ")"; |
| 134 pause_video_ = !video_control.enable(); | 134 pause_video_ = !video_control.enable(); |
| 135 if (video_stream_) | 135 if (video_stream_) |
| 136 video_stream_->Pause(pause_video_); | 136 video_stream_->Pause(pause_video_); |
| 137 } | 137 } |
| 138 if (video_control.has_lossless_encode()) { | 138 if (video_control.has_lossless_encode()) { |
| 139 VLOG(1) << "Received VideoControl (lossless_encode=" | 139 VLOG(1) << "Received VideoControl (lossless_encode=" |
| 140 << video_control.lossless_encode() << ")"; | 140 << video_control.lossless_encode() << ")"; |
| 141 lossless_video_encode_ = video_control.lossless_encode(); | 141 lossless_video_encode_ = video_control.lossless_encode(); |
| 142 if (video_stream_) | 142 if (video_stream_) |
| 143 video_stream_->SetLosslessEncode(lossless_video_encode_); | 143 video_stream_->SetLosslessEncode(lossless_video_encode_); |
| 144 } | 144 } |
| 145 if (video_control.has_lossless_color()) { | 145 if (video_control.has_lossless_color()) { |
| 146 VLOG(1) << "Received VideoControl (lossless_color=" | 146 VLOG(1) << "Received VideoControl (lossless_color=" |
| 147 << video_control.lossless_color() << ")"; | 147 << video_control.lossless_color() << ")"; |
| 148 lossless_video_color_ = video_control.lossless_color(); | 148 lossless_video_color_ = video_control.lossless_color(); |
| 149 if (video_stream_) | 149 if (video_stream_) |
| 150 video_stream_->SetLosslessColor(lossless_video_color_); | 150 video_stream_->SetLosslessColor(lossless_video_color_); |
| 151 } | 151 } |
| 152 } | 152 } |
| 153 | 153 |
| 154 void ClientSession::ControlAudio(const protocol::AudioControl& audio_control) { | 154 void ClientSession::ControlAudio(const protocol::AudioControl& audio_control) { |
| 155 DCHECK(CalledOnValidThread()); | 155 DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); |
| 156 | 156 |
| 157 if (audio_control.has_enable()) { | 157 if (audio_control.has_enable()) { |
| 158 VLOG(1) << "Received AudioControl (enable=" | 158 VLOG(1) << "Received AudioControl (enable=" |
| 159 << audio_control.enable() << ")"; | 159 << audio_control.enable() << ")"; |
| 160 if (audio_stream_) | 160 if (audio_stream_) |
| 161 audio_stream_->Pause(!audio_control.enable()); | 161 audio_stream_->Pause(!audio_control.enable()); |
| 162 } | 162 } |
| 163 } | 163 } |
| 164 | 164 |
| 165 void ClientSession::SetCapabilities( | 165 void ClientSession::SetCapabilities( |
| 166 const protocol::Capabilities& capabilities) { | 166 const protocol::Capabilities& capabilities) { |
| 167 DCHECK(CalledOnValidThread()); | 167 DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); |
| 168 | 168 |
| 169 // Ignore all the messages but the 1st one. | 169 // Ignore all the messages but the 1st one. |
| 170 if (client_capabilities_) { | 170 if (client_capabilities_) { |
| 171 LOG(WARNING) << "protocol::Capabilities has been received already."; | 171 LOG(WARNING) << "protocol::Capabilities has been received already."; |
| 172 return; | 172 return; |
| 173 } | 173 } |
| 174 | 174 |
| 175 // Compute the set of capabilities supported by both client and host. | 175 // Compute the set of capabilities supported by both client and host. |
| 176 client_capabilities_ = base::MakeUnique<std::string>(); | 176 client_capabilities_ = base::MakeUnique<std::string>(); |
| 177 if (capabilities.has_capabilities()) | 177 if (capabilities.has_capabilities()) |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 216 << message.type() << ": " << message.data(); | 216 << message.type() << ": " << message.data(); |
| 217 } | 217 } |
| 218 } | 218 } |
| 219 } | 219 } |
| 220 | 220 |
| 221 void ClientSession::OnConnectionAuthenticating() { | 221 void ClientSession::OnConnectionAuthenticating() { |
| 222 event_handler_->OnSessionAuthenticating(this); | 222 event_handler_->OnSessionAuthenticating(this); |
| 223 } | 223 } |
| 224 | 224 |
| 225 void ClientSession::OnConnectionAuthenticated() { | 225 void ClientSession::OnConnectionAuthenticated() { |
| 226 DCHECK(CalledOnValidThread()); | 226 DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); |
| 227 DCHECK(!audio_stream_); | 227 DCHECK(!audio_stream_); |
| 228 DCHECK(!desktop_environment_); | 228 DCHECK(!desktop_environment_); |
| 229 DCHECK(!input_injector_); | 229 DCHECK(!input_injector_); |
| 230 DCHECK(!screen_controls_); | 230 DCHECK(!screen_controls_); |
| 231 DCHECK(!video_stream_); | 231 DCHECK(!video_stream_); |
| 232 | 232 |
| 233 is_authenticated_ = true; | 233 is_authenticated_ = true; |
| 234 | 234 |
| 235 if (max_duration_ > base::TimeDelta()) { | 235 if (max_duration_ > base::TimeDelta()) { |
| 236 max_duration_timer_.Start( | 236 max_duration_timer_.Start( |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 273 connection_->set_input_stub(&disable_input_filter_); | 273 connection_->set_input_stub(&disable_input_filter_); |
| 274 host_input_filter_.set_input_stub(input_injector_.get()); | 274 host_input_filter_.set_input_stub(input_injector_.get()); |
| 275 | 275 |
| 276 // Connect the clipboard stubs. | 276 // Connect the clipboard stubs. |
| 277 connection_->set_clipboard_stub(&disable_clipboard_filter_); | 277 connection_->set_clipboard_stub(&disable_clipboard_filter_); |
| 278 clipboard_echo_filter_.set_host_stub(input_injector_.get()); | 278 clipboard_echo_filter_.set_host_stub(input_injector_.get()); |
| 279 clipboard_echo_filter_.set_client_stub(connection_->client_stub()); | 279 clipboard_echo_filter_.set_client_stub(connection_->client_stub()); |
| 280 } | 280 } |
| 281 | 281 |
| 282 void ClientSession::CreateMediaStreams() { | 282 void ClientSession::CreateMediaStreams() { |
| 283 DCHECK(CalledOnValidThread()); | 283 DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); |
| 284 | 284 |
| 285 // Create a VideoStream to pump frames from the capturer to the client. | 285 // Create a VideoStream to pump frames from the capturer to the client. |
| 286 video_stream_ = connection_->StartVideoStream( | 286 video_stream_ = connection_->StartVideoStream( |
| 287 desktop_environment_->CreateVideoCapturer()); | 287 desktop_environment_->CreateVideoCapturer()); |
| 288 | 288 |
| 289 // Create a AudioStream to pump audio from the capturer to the client. | 289 // Create a AudioStream to pump audio from the capturer to the client. |
| 290 std::unique_ptr<protocol::AudioSource> audio_capturer = | 290 std::unique_ptr<protocol::AudioSource> audio_capturer = |
| 291 desktop_environment_->CreateAudioCapturer(); | 291 desktop_environment_->CreateAudioCapturer(); |
| 292 if (audio_capturer) { | 292 if (audio_capturer) { |
| 293 audio_stream_ = connection_->StartAudioStream(std::move(audio_capturer)); | 293 audio_stream_ = connection_->StartAudioStream(std::move(audio_capturer)); |
| 294 } | 294 } |
| 295 | 295 |
| 296 video_stream_->SetObserver(this); | 296 video_stream_->SetObserver(this); |
| 297 | 297 |
| 298 // Apply video-control parameters to the new stream. | 298 // Apply video-control parameters to the new stream. |
| 299 video_stream_->SetLosslessEncode(lossless_video_encode_); | 299 video_stream_->SetLosslessEncode(lossless_video_encode_); |
| 300 video_stream_->SetLosslessColor(lossless_video_color_); | 300 video_stream_->SetLosslessColor(lossless_video_color_); |
| 301 | 301 |
| 302 // Pause capturing if necessary. | 302 // Pause capturing if necessary. |
| 303 video_stream_->Pause(pause_video_); | 303 video_stream_->Pause(pause_video_); |
| 304 | 304 |
| 305 if (event_timestamp_source_for_tests_) | 305 if (event_timestamp_source_for_tests_) |
| 306 video_stream_->SetEventTimestampsSource(event_timestamp_source_for_tests_); | 306 video_stream_->SetEventTimestampsSource(event_timestamp_source_for_tests_); |
| 307 } | 307 } |
| 308 | 308 |
| 309 void ClientSession::OnConnectionChannelsConnected() { | 309 void ClientSession::OnConnectionChannelsConnected() { |
| 310 DCHECK(CalledOnValidThread()); | 310 DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); |
| 311 | 311 |
| 312 DCHECK(!channels_connected_); | 312 DCHECK(!channels_connected_); |
| 313 channels_connected_ = true; | 313 channels_connected_ = true; |
| 314 | 314 |
| 315 // Negotiate capabilities with the client. | 315 // Negotiate capabilities with the client. |
| 316 VLOG(1) << "Host capabilities: " << host_capabilities_; | 316 VLOG(1) << "Host capabilities: " << host_capabilities_; |
| 317 protocol::Capabilities capabilities; | 317 protocol::Capabilities capabilities; |
| 318 capabilities.set_capabilities(host_capabilities_); | 318 capabilities.set_capabilities(host_capabilities_); |
| 319 connection_->client_stub()->SetCapabilities(capabilities); | 319 connection_->client_stub()->SetCapabilities(capabilities); |
| 320 | 320 |
| 321 // Start the event executor. | 321 // Start the event executor. |
| 322 input_injector_->Start(CreateClipboardProxy()); | 322 input_injector_->Start(CreateClipboardProxy()); |
| 323 SetDisableInputs(false); | 323 SetDisableInputs(false); |
| 324 | 324 |
| 325 // Create MouseShapePump to send mouse cursor shape. | 325 // Create MouseShapePump to send mouse cursor shape. |
| 326 mouse_shape_pump_.reset( | 326 mouse_shape_pump_.reset( |
| 327 new MouseShapePump(desktop_environment_->CreateMouseCursorMonitor(), | 327 new MouseShapePump(desktop_environment_->CreateMouseCursorMonitor(), |
| 328 connection_->client_stub())); | 328 connection_->client_stub())); |
| 329 | 329 |
| 330 if (pending_video_layout_message_) { | 330 if (pending_video_layout_message_) { |
| 331 connection_->client_stub()->SetVideoLayout(*pending_video_layout_message_); | 331 connection_->client_stub()->SetVideoLayout(*pending_video_layout_message_); |
| 332 pending_video_layout_message_.reset(); | 332 pending_video_layout_message_.reset(); |
| 333 } | 333 } |
| 334 | 334 |
| 335 // Notify the event handler that all our channels are now connected. | 335 // Notify the event handler that all our channels are now connected. |
| 336 event_handler_->OnSessionChannelsConnected(this); | 336 event_handler_->OnSessionChannelsConnected(this); |
| 337 } | 337 } |
| 338 | 338 |
| 339 void ClientSession::OnConnectionClosed(protocol::ErrorCode error) { | 339 void ClientSession::OnConnectionClosed(protocol::ErrorCode error) { |
| 340 DCHECK(CalledOnValidThread()); | 340 DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); |
| 341 | 341 |
| 342 HOST_LOG << "Client disconnected: " << client_jid_ << "; error = " << error; | 342 HOST_LOG << "Client disconnected: " << client_jid_ << "; error = " << error; |
| 343 | 343 |
| 344 // Ignore any further callbacks. | 344 // Ignore any further callbacks. |
| 345 weak_factory_.InvalidateWeakPtrs(); | 345 weak_factory_.InvalidateWeakPtrs(); |
| 346 | 346 |
| 347 // If the client never authenticated then the session failed. | 347 // If the client never authenticated then the session failed. |
| 348 if (!is_authenticated_) | 348 if (!is_authenticated_) |
| 349 event_handler_->OnSessionAuthenticationFailed(this); | 349 event_handler_->OnSessionAuthenticationFailed(this); |
| 350 | 350 |
| (...skipping 10 matching lines...) Expand all Loading... |
| 361 screen_controls_.reset(); | 361 screen_controls_.reset(); |
| 362 desktop_environment_.reset(); | 362 desktop_environment_.reset(); |
| 363 | 363 |
| 364 // Notify the ChromotingHost that this client is disconnected. | 364 // Notify the ChromotingHost that this client is disconnected. |
| 365 event_handler_->OnSessionClosed(this); | 365 event_handler_->OnSessionClosed(this); |
| 366 } | 366 } |
| 367 | 367 |
| 368 void ClientSession::OnRouteChange( | 368 void ClientSession::OnRouteChange( |
| 369 const std::string& channel_name, | 369 const std::string& channel_name, |
| 370 const protocol::TransportRoute& route) { | 370 const protocol::TransportRoute& route) { |
| 371 DCHECK(CalledOnValidThread()); | 371 DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); |
| 372 event_handler_->OnSessionRouteChange(this, channel_name, route); | 372 event_handler_->OnSessionRouteChange(this, channel_name, route); |
| 373 } | 373 } |
| 374 | 374 |
| 375 const std::string& ClientSession::client_jid() const { | 375 const std::string& ClientSession::client_jid() const { |
| 376 return client_jid_; | 376 return client_jid_; |
| 377 } | 377 } |
| 378 | 378 |
| 379 void ClientSession::DisconnectSession(protocol::ErrorCode error) { | 379 void ClientSession::DisconnectSession(protocol::ErrorCode error) { |
| 380 DCHECK(CalledOnValidThread()); | 380 DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); |
| 381 DCHECK(connection_.get()); | 381 DCHECK(connection_.get()); |
| 382 | 382 |
| 383 max_duration_timer_.Stop(); | 383 max_duration_timer_.Stop(); |
| 384 | 384 |
| 385 // This triggers OnConnectionClosed(), and the session may be destroyed | 385 // This triggers OnConnectionClosed(), and the session may be destroyed |
| 386 // as the result, so this call must be the last in this method. | 386 // as the result, so this call must be the last in this method. |
| 387 connection_->Disconnect(error); | 387 connection_->Disconnect(error); |
| 388 } | 388 } |
| 389 | 389 |
| 390 void ClientSession::OnLocalMouseMoved(const webrtc::DesktopVector& position) { | 390 void ClientSession::OnLocalMouseMoved(const webrtc::DesktopVector& position) { |
| 391 DCHECK(CalledOnValidThread()); | 391 DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); |
| 392 remote_input_filter_.LocalMouseMoved(position); | 392 remote_input_filter_.LocalMouseMoved(position); |
| 393 } | 393 } |
| 394 | 394 |
| 395 void ClientSession::SetDisableInputs(bool disable_inputs) { | 395 void ClientSession::SetDisableInputs(bool disable_inputs) { |
| 396 DCHECK(CalledOnValidThread()); | 396 DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); |
| 397 | 397 |
| 398 if (disable_inputs) | 398 if (disable_inputs) |
| 399 input_tracker_.ReleaseAll(); | 399 input_tracker_.ReleaseAll(); |
| 400 | 400 |
| 401 disable_input_filter_.set_enabled(!disable_inputs); | 401 disable_input_filter_.set_enabled(!disable_inputs); |
| 402 disable_clipboard_filter_.set_enabled(!disable_inputs); | 402 disable_clipboard_filter_.set_enabled(!disable_inputs); |
| 403 } | 403 } |
| 404 | 404 |
| 405 uint32_t ClientSession::desktop_session_id() const { | 405 uint32_t ClientSession::desktop_session_id() const { |
| 406 DCHECK(CalledOnValidThread()); | 406 DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); |
| 407 DCHECK(desktop_environment_); | 407 DCHECK(desktop_environment_); |
| 408 return desktop_environment_->GetDesktopSessionId(); | 408 return desktop_environment_->GetDesktopSessionId(); |
| 409 } | 409 } |
| 410 | 410 |
| 411 ClientSessionControl* ClientSession::session_control() { | 411 ClientSessionControl* ClientSession::session_control() { |
| 412 DCHECK(CalledOnValidThread()); | 412 DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); |
| 413 return this; | 413 return this; |
| 414 } | 414 } |
| 415 | 415 |
| 416 void ClientSession::SetEventTimestampsSourceForTests( | 416 void ClientSession::SetEventTimestampsSourceForTests( |
| 417 scoped_refptr<protocol::InputEventTimestampsSource> | 417 scoped_refptr<protocol::InputEventTimestampsSource> |
| 418 event_timestamp_source) { | 418 event_timestamp_source) { |
| 419 DCHECK(CalledOnValidThread()); | 419 DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); |
| 420 event_timestamp_source_for_tests_ = event_timestamp_source; | 420 event_timestamp_source_for_tests_ = event_timestamp_source; |
| 421 if (video_stream_) | 421 if (video_stream_) |
| 422 video_stream_->SetEventTimestampsSource(event_timestamp_source_for_tests_); | 422 video_stream_->SetEventTimestampsSource(event_timestamp_source_for_tests_); |
| 423 } | 423 } |
| 424 | 424 |
| 425 std::unique_ptr<protocol::ClipboardStub> ClientSession::CreateClipboardProxy() { | 425 std::unique_ptr<protocol::ClipboardStub> ClientSession::CreateClipboardProxy() { |
| 426 DCHECK(CalledOnValidThread()); | 426 DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); |
| 427 return base::MakeUnique<protocol::ClipboardThreadProxy>( | 427 return base::MakeUnique<protocol::ClipboardThreadProxy>( |
| 428 client_clipboard_factory_.GetWeakPtr(), | 428 client_clipboard_factory_.GetWeakPtr(), |
| 429 base::ThreadTaskRunnerHandle::Get()); | 429 base::ThreadTaskRunnerHandle::Get()); |
| 430 } | 430 } |
| 431 | 431 |
| 432 void ClientSession::OnVideoSizeChanged(protocol::VideoStream* video_stream, | 432 void ClientSession::OnVideoSizeChanged(protocol::VideoStream* video_stream, |
| 433 const webrtc::DesktopSize& size, | 433 const webrtc::DesktopSize& size, |
| 434 const webrtc::DesktopVector& dpi) { | 434 const webrtc::DesktopVector& dpi) { |
| 435 DCHECK(CalledOnValidThread()); | 435 DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); |
| 436 | 436 |
| 437 mouse_clamping_filter_.set_output_size(size); | 437 mouse_clamping_filter_.set_output_size(size); |
| 438 | 438 |
| 439 switch (connection_->session()->config().protocol()) { | 439 switch (connection_->session()->config().protocol()) { |
| 440 case protocol::SessionConfig::Protocol::ICE: | 440 case protocol::SessionConfig::Protocol::ICE: |
| 441 mouse_clamping_filter_.set_input_size(size); | 441 mouse_clamping_filter_.set_input_size(size); |
| 442 break; | 442 break; |
| 443 | 443 |
| 444 case protocol::SessionConfig::Protocol::WEBRTC: { | 444 case protocol::SessionConfig::Protocol::WEBRTC: { |
| 445 // When using WebRTC protocol the client sends mouse coordinates in DIPs, | 445 // When using WebRTC protocol the client sends mouse coordinates in DIPs, |
| (...skipping 20 matching lines...) Expand all Loading... |
| 466 connection_->client_stub()->SetVideoLayout(layout); | 466 connection_->client_stub()->SetVideoLayout(layout); |
| 467 } else { | 467 } else { |
| 468 pending_video_layout_message_.reset(new protocol::VideoLayout(layout)); | 468 pending_video_layout_message_.reset(new protocol::VideoLayout(layout)); |
| 469 } | 469 } |
| 470 break; | 470 break; |
| 471 } | 471 } |
| 472 } | 472 } |
| 473 } | 473 } |
| 474 | 474 |
| 475 } // namespace remoting | 475 } // namespace remoting |
| OLD | NEW |