Commit 006765f9 authored by Joe Downing's avatar Joe Downing Committed by Commit Bot

[Windows Host] Prevent crash on Windows when sending an empty resolution

This CL fixes an issue introduced by a previous change which allowed clients
to pass an empty resolution to indicate that the host should restore the
original desktop size.

This change worked for Linux and MacOS as they only have a single process which
contains the HostResizeObserver that handles this condition.

On Windows, we have a multi-process architecture where the empty resolution
was forwarded to both the desktop process (which has the HostResize Logic)
and the Daemon process (which treats an empty resolution as a critical
error).

Enabling the host resize logic for RDP is not very useful so I have just added
a check to make sure we don't forward empty resolution values to the Daemon
process.

BUG=869509

Change-Id: I87be6beb3137641ad728c4725f587a7e7f15a48f
Reviewed-on: https://chromium-review.googlesource.com/1157540
Commit-Queue: Joe Downing <joedow@chromium.org>
Reviewed-by: default avatarJamie Walch <jamiewalch@chromium.org>
Cr-Commit-Position: refs/heads/master@{#579698}
parent 3ac3edc2
......@@ -386,8 +386,14 @@ void DesktopSessionProxy::SetScreenResolution(
// Depending on the session kind the screen resolution can be set by either
// the daemon (for example RDP sessions on Windows) or by the desktop session
// agent (when sharing the physical console).
if (desktop_session_connector_.get())
// Desktop-size-restore functionality (via an empty resolution param) does not
// exist for the Daemon process. Passing an empty resolution object is
// treated as a critical error so we want to prevent that here.
if (desktop_session_connector_.get() && !screen_resolution_.IsEmpty())
desktop_session_connector_->SetScreenResolution(this, screen_resolution_);
// Passing an empty |screen_resolution_| value to the desktop process
// indicates that the original resolution, if one exists, should be restored.
SendToDesktop(
new ChromotingNetworkDesktopMsg_SetScreenResolution(screen_resolution_));
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment