Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1183)

Unified Diff: remoting/host/win/rdp_client_window.h

Issue 2600623002: Adding retry logic for applying desktop resolution changes to RDP session. (Closed)
Patch Set: Addressing CR feedback Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | remoting/host/win/rdp_client_window.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/host/win/rdp_client_window.h
diff --git a/remoting/host/win/rdp_client_window.h b/remoting/host/win/rdp_client_window.h
index a7b1159f405666b32236ed50c797534ece761c5b..3461846a3cb8d30a82cb94d9e7320838c506c132 100644
--- a/remoting/host/win/rdp_client_window.h
+++ b/remoting/host/win/rdp_client_window.h
@@ -12,6 +12,7 @@
#include "base/memory/ref_counted.h"
#include "base/message_loop/message_loop.h"
+#include "base/timer/timer.h"
#include "base/win/scoped_comptr.h"
#include "net/base/ip_endpoint.h"
#include "remoting/host/screen_resolution.h"
@@ -135,13 +136,21 @@ class RdpClientWindow
int LogOnCreateError(HRESULT error);
// Wrappers for the event handler's methods that make sure that
- // OnDisconnected() is the last notification delivered and is delevered
+ // OnDisconnected() is the last notification delivered and is delivered
// only once.
void NotifyConnected();
void NotifyDisconnected();
// Updates the desktop using |screen_resolution_| if resizing is supported.
- void UpdateDesktopResolution();
+ HRESULT UpdateDesktopResolution();
+
+ // Attempts to reapply the requested screen resolution. This method is used
+ // to workaround the inconsistent behavior seen by the RDP API which can fail
+ // for an indeterminate amount of time (i.e. a few seconds) after the user has
+ // logged into the session. In practice retrying after ~100ms will succeed,
+ // but we will use |apply_resolution_timer_| to try a few times if the machine
+ // is under load.
+ void ReapplyDesktopResolution();
// Invoked to report connect/disconnect events.
EventHandler* event_handler_;
@@ -149,6 +158,12 @@ class RdpClientWindow
// Contains the requested dimensions of the screen.
remoting::ScreenResolution screen_resolution_;
+ // Used for applying resolution changes after a timeout.
+ base::RepeatingTimer apply_resolution_timer_;
+
+ // Tracks the number of resolution change retries.
+ int apply_resolution_attempts_ = 0;
+
// The endpoint to connect to.
net::IPEndPoint server_endpoint_;
« no previous file with comments | « no previous file | remoting/host/win/rdp_client_window.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698