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

Side by Side Diff: remoting/webapp/client_plugin_async.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, 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 /** 5 /**
6 * @fileoverview 6 * @fileoverview
7 * Class that wraps low-level details of interacting with the client plugin. 7 * Class that wraps low-level details of interacting with the client plugin.
8 * 8 *
9 * This abstracts a <embed> element and controls the plugin which does 9 * This abstracts a <embed> element and controls the plugin which does
10 * the actual remoting work. It also handles differences between 10 * the actual remoting work. It also handles differences between
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after
164 // At the moment the webapp does not recognize any of 164 // At the moment the webapp does not recognize any of
165 // 'requestedCapabilities' capabilities (so they all should be disabled) 165 // 'requestedCapabilities' capabilities (so they all should be disabled)
166 // and do not care about any of 'supportedCapabilities' capabilities (so 166 // and do not care about any of 'supportedCapabilities' capabilities (so
167 // they all can be enabled). 167 // they all can be enabled).
168 this.capabilities_ = supportedCapabilities; 168 this.capabilities_ = supportedCapabilities;
169 169
170 // Let the host know that the webapp can be requested to always send 170 // Let the host know that the webapp can be requested to always send
171 // the client's dimensions. 171 // the client's dimensions.
172 this.capabilities_.push( 172 this.capabilities_.push(
173 remoting.ClientSession.Capability.SEND_INITIAL_RESOLUTION); 173 remoting.ClientSession.Capability.SEND_INITIAL_RESOLUTION);
174
175 // Let the host know that we're interested in knowing whether or not
176 // it rate-limits desktop-resize requests.
177 this.capabilities_.push(
178 remoting.ClientSession.Capability.RATE_LIMIT_RESIZE_REQUESTS);
174 } else if (this.pluginApiVersion_ >= 6) { 179 } else if (this.pluginApiVersion_ >= 6) {
175 this.pluginApiFeatures_ = ['highQualityScaling', 'injectKeyEvent']; 180 this.pluginApiFeatures_ = ['highQualityScaling', 'injectKeyEvent'];
176 } else { 181 } else {
177 this.pluginApiFeatures_ = ['highQualityScaling']; 182 this.pluginApiFeatures_ = ['highQualityScaling'];
178 } 183 }
179 this.pluginApiMinVersion_ = 184 this.pluginApiMinVersion_ =
180 /** @type {number} */ message.data['apiMinVersion']; 185 /** @type {number} */ message.data['apiMinVersion'];
181 this.helloReceived_ = true; 186 this.helloReceived_ = true;
182 if (this.onInitializedCallback_ != null) { 187 if (this.onInitializedCallback_ != null) {
183 this.onInitializedCallback_(true); 188 this.onInitializedCallback_(true);
(...skipping 396 matching lines...) Expand 10 before | Expand all | Expand 10 after
580 this.plugin.width = width; 585 this.plugin.width = width;
581 this.plugin.height = height; 586 this.plugin.height = height;
582 // Center the plugin just underneath the "Connnecting..." dialog. 587 // Center the plugin just underneath the "Connnecting..." dialog.
583 var parentNode = this.plugin.parentNode; 588 var parentNode = this.plugin.parentNode;
584 var dialog = document.getElementById('client-dialog'); 589 var dialog = document.getElementById('client-dialog');
585 var dialogRect = dialog.getBoundingClientRect(); 590 var dialogRect = dialog.getBoundingClientRect();
586 parentNode.style.top = (dialogRect.bottom + 16) + 'px'; 591 parentNode.style.top = (dialogRect.bottom + 16) + 'px';
587 parentNode.style.left = (window.innerWidth - width) / 2 + 'px'; 592 parentNode.style.left = (window.innerWidth - width) / 2 + 'px';
588 } 593 }
589 }; 594 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698