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

Unified Diff: remoting/webapp/client_session.js

Issue 15927033: Add host-side rate-limiting to desktop resize events. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Reviewer feedback. Created 7 years, 7 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
Index: remoting/webapp/client_session.js
diff --git a/remoting/webapp/client_session.js b/remoting/webapp/client_session.js
index f40fa850addd071aff82e537e50b808fc90817c3..7f8315239ae994dbd5e02e69938ce1d051e467cc 100644
--- a/remoting/webapp/client_session.js
+++ b/remoting/webapp/client_session.js
@@ -244,7 +244,8 @@ remoting.ClientSession.Capability = {
// When enabled this capability causes the client to send its screen
// resolution to the host once connection has been established. See
// this.plugin.notifyClientResolution().
- SEND_INITIAL_RESOLUTION: 'sendInitialResolution'
+ SEND_INITIAL_RESOLUTION: 'sendInitialResolution',
+ RATE_LIMIT_RESIZE_REQUESTS: 'rateLimitResizeRequests'
};
/**
@@ -880,12 +881,17 @@ remoting.ClientSession.prototype.onResize = function() {
// Defer notifying the host of the change until the window stops resizing, to
// avoid overloading the control channel with notifications.
if (this.resizeToClient_) {
+ var kResizeRateLimitMs = 1000;
+ if (this.hasCapability_(
+ remoting.ClientSession.Capability.RATE_LIMIT_RESIZE_REQUESTS)) {
+ kResizeRateLimitMs = 250;
+ }
this.notifyClientResolutionTimer_ = window.setTimeout(
this.plugin.notifyClientResolution.bind(this.plugin,
window.innerWidth,
window.innerHeight,
window.devicePixelRatio),
- 1000);
+ kResizeRateLimitMs);
}
// If bump-scrolling is enabled, adjust the plugin margins to fully utilize
« remoting/host/resizing_host_observer.cc ('K') | « remoting/webapp/client_plugin_async.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698