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

Unified Diff: third_party/WebKit/Source/devtools/front_end/ui/ThrottledWidget.js

Issue 2466123002: DevTools: reformat front-end code to match chromium style. (Closed)
Patch Set: all done Created 4 years, 1 month 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: 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();
+ }
};

Powered by Google App Engine
This is Rietveld 408576698