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

Unified Diff: third_party/WebKit/Source/devtools/front_end/layers/LayerPaintProfilerView.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/layers/LayerPaintProfilerView.js
diff --git a/third_party/WebKit/Source/devtools/front_end/layers/LayerPaintProfilerView.js b/third_party/WebKit/Source/devtools/front_end/layers/LayerPaintProfilerView.js
index 08a923e09d145240f250b8d70427de058109af1f..7d96d292f46512dc3f3bed8b45d1840547e8c9b9 100644
--- a/third_party/WebKit/Source/devtools/front_end/layers/LayerPaintProfilerView.js
+++ b/third_party/WebKit/Source/devtools/front_end/layers/LayerPaintProfilerView.js
@@ -1,65 +1,57 @@
// 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.SplitWidget}
- * @param {function(string=)} showImageCallback
+ * @unrestricted
*/
-WebInspector.LayerPaintProfilerView = function(showImageCallback)
-{
- WebInspector.SplitWidget.call(this, true, false);
+WebInspector.LayerPaintProfilerView = class extends WebInspector.SplitWidget {
+ /**
+ * @param {function(string=)} showImageCallback
+ */
+ constructor(showImageCallback) {
+ super(true, false);
this._logTreeView = new WebInspector.PaintProfilerCommandLogView();
this.setSidebarWidget(this._logTreeView);
this._paintProfilerView = new WebInspector.PaintProfilerView(showImageCallback);
this.setMainWidget(this._paintProfilerView);
- this._paintProfilerView.addEventListener(WebInspector.PaintProfilerView.Events.WindowChanged, this._onWindowChanged, this);
-};
-
-WebInspector.LayerPaintProfilerView.prototype = {
- reset: function()
- {
- this._paintProfilerView.setSnapshotAndLog(null, [], null);
- },
+ this._paintProfilerView.addEventListener(
+ WebInspector.PaintProfilerView.Events.WindowChanged, this._onWindowChanged, this);
+ }
- /**
- * @param {!WebInspector.PaintProfilerSnapshot} snapshot
- */
- profile: function(snapshot)
- {
- this._showImageCallback = null;
- snapshot.commandLog().then(log => setSnapshotAndLog.call(this, snapshot, log));
+ reset() {
+ this._paintProfilerView.setSnapshotAndLog(null, [], null);
+ }
- /**
- * @param {?WebInspector.PaintProfilerSnapshot} snapshot
- * @param {?Array<!WebInspector.PaintProfilerLogItem>} log
- * @this {WebInspector.LayerPaintProfilerView}
- */
- function setSnapshotAndLog(snapshot, log)
- {
- this._logTreeView.setCommandLog(snapshot && snapshot.target(), log || []);
- this._paintProfilerView.setSnapshotAndLog(snapshot, log || [], null);
- if (snapshot)
- snapshot.release();
- }
- },
+ /**
+ * @param {!WebInspector.PaintProfilerSnapshot} snapshot
+ */
+ profile(snapshot) {
+ this._showImageCallback = null;
+ snapshot.commandLog().then(log => setSnapshotAndLog.call(this, snapshot, log));
/**
- * @param {number} scale
+ * @param {?WebInspector.PaintProfilerSnapshot} snapshot
+ * @param {?Array<!WebInspector.PaintProfilerLogItem>} log
+ * @this {WebInspector.LayerPaintProfilerView}
*/
- setScale: function(scale)
- {
- this._paintProfilerView.setScale(scale);
- },
-
- _onWindowChanged: function()
- {
- this._logTreeView.updateWindow(this._paintProfilerView.selectionWindow());
- },
-
- __proto__: WebInspector.SplitWidget.prototype
+ function setSnapshotAndLog(snapshot, log) {
+ this._logTreeView.setCommandLog(snapshot && snapshot.target(), log || []);
+ this._paintProfilerView.setSnapshotAndLog(snapshot, log || [], null);
+ if (snapshot)
+ snapshot.release();
+ }
+ }
+
+ /**
+ * @param {number} scale
+ */
+ setScale(scale) {
+ this._paintProfilerView.setScale(scale);
+ }
+
+ _onWindowChanged() {
+ this._logTreeView.updateWindow(this._paintProfilerView.selectionWindow());
+ }
};
-

Powered by Google App Engine
This is Rietveld 408576698