Index: third_party/WebKit/Source/devtools/front_end/ui/ThrottledWidget.js |
diff --git a/third_party/WebKit/Source/devtools/front_end/ui/ThrottledWidget.js b/third_party/WebKit/Source/devtools/front_end/ui/ThrottledWidget.js |
index 56aebe4d7a30feb4899fe3f64b26ebeeb0d78bfe..26becf5c67082e889e6cbe9e057688452dcd7ca5 100644 |
--- a/third_party/WebKit/Source/devtools/front_end/ui/ThrottledWidget.js |
+++ b/third_party/WebKit/Source/devtools/front_end/ui/ThrottledWidget.js |
@@ -1,58 +1,51 @@ |
// Copyright 2014 The Chromium Authors. All rights reserved. |
// Use of this source code is governed by a BSD-style license that can be |
// found in the LICENSE file. |
- |
/** |
- * @constructor |
- * @extends {WebInspector.VBox} |
- * @param {boolean=} isWebComponent |
+ * @unrestricted |
*/ |
-WebInspector.ThrottledWidget = function(isWebComponent) |
-{ |
- WebInspector.VBox.call(this, isWebComponent); |
+WebInspector.ThrottledWidget = class extends WebInspector.VBox { |
+ /** |
+ * @param {boolean=} isWebComponent |
+ */ |
+ constructor(isWebComponent) { |
+ super(isWebComponent); |
this._updateThrottler = new WebInspector.Throttler(100); |
this._updateWhenVisible = false; |
-}; |
+ } |
-WebInspector.ThrottledWidget.prototype = { |
- /** |
- * @protected |
- * @return {!Promise<?>} |
- */ |
- doUpdate: function() |
- { |
- return Promise.resolve(); |
- }, |
- |
- update: function() |
- { |
- this._updateWhenVisible = !this.isShowing(); |
- if (this._updateWhenVisible) |
- return; |
- this._updateThrottler.schedule(innerUpdate.bind(this)); |
+ /** |
+ * @protected |
+ * @return {!Promise<?>} |
+ */ |
+ doUpdate() { |
+ return Promise.resolve(); |
+ } |
- /** |
- * @this {WebInspector.ThrottledWidget} |
- * @return {!Promise<?>} |
- */ |
- function innerUpdate() |
- { |
- if (this.isShowing()) |
- return this.doUpdate(); |
- this._updateWhenVisible = true; |
- return Promise.resolve(); |
- } |
- }, |
+ update() { |
+ this._updateWhenVisible = !this.isShowing(); |
+ if (this._updateWhenVisible) |
+ return; |
+ this._updateThrottler.schedule(innerUpdate.bind(this)); |
/** |
- * @override |
+ * @this {WebInspector.ThrottledWidget} |
+ * @return {!Promise<?>} |
*/ |
- wasShown: function() |
- { |
- WebInspector.VBox.prototype.wasShown.call(this); |
- if (this._updateWhenVisible) |
- this.update(); |
- }, |
+ function innerUpdate() { |
+ if (this.isShowing()) |
+ return this.doUpdate(); |
+ this._updateWhenVisible = true; |
+ return Promise.resolve(); |
+ } |
+ } |
- __proto__: WebInspector.VBox.prototype |
+ /** |
+ * @override |
+ */ |
+ wasShown() { |
+ super.wasShown(); |
+ if (this._updateWhenVisible) |
+ this.update(); |
+ } |
}; |