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

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: Rebase Created 7 years, 6 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 | « remoting/webapp/client_plugin_async.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/webapp/client_session.js
diff --git a/remoting/webapp/client_session.js b/remoting/webapp/client_session.js
index b81260dc8c1fb21467d3f17579c9b77464d218b7..7a87a52e691a558ad610cbac68e9fd1bea7f2736 100644
--- a/remoting/webapp/client_session.js
+++ b/remoting/webapp/client_session.js
@@ -254,7 +254,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'
};
/**
@@ -890,12 +891,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
« no previous file with comments | « remoting/webapp/client_plugin_async.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698