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

Unified Diff: third_party/WebKit/Source/devtools/front_end/timeline/MemoryCountersGraph.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/timeline/MemoryCountersGraph.js
diff --git a/third_party/WebKit/Source/devtools/front_end/timeline/MemoryCountersGraph.js b/third_party/WebKit/Source/devtools/front_end/timeline/MemoryCountersGraph.js
index c68208bf2b7d515f7beb543c10311751d30ae288..b014a170f47322bc85859aacdb8d346565f185b2 100644
--- a/third_party/WebKit/Source/devtools/front_end/timeline/MemoryCountersGraph.js
+++ b/third_party/WebKit/Source/devtools/front_end/timeline/MemoryCountersGraph.js
@@ -27,55 +27,58 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-
/**
- * @constructor
- * @extends {WebInspector.CountersGraph}
* @implements {WebInspector.TimelineModeView}
- * @param {!WebInspector.TimelineModeViewDelegate} delegate
- * @param {!WebInspector.TimelineModel} model
- * @param {!Array<!WebInspector.TimelineModel.Filter>} filters
+ * @unrestricted
*/
-WebInspector.MemoryCountersGraph = function(delegate, model, filters)
-{
- WebInspector.CountersGraph.call(this, delegate, model, filters);
+WebInspector.MemoryCountersGraph = class extends WebInspector.CountersGraph {
+ /**
+ * @param {!WebInspector.TimelineModeViewDelegate} delegate
+ * @param {!WebInspector.TimelineModel} model
+ * @param {!Array<!WebInspector.TimelineModel.Filter>} filters
+ */
+ constructor(delegate, model, filters) {
+ super(delegate, model, filters);
this._countersByName = {};
- this._countersByName["jsHeapSizeUsed"] = this.createCounter(WebInspector.UIString("JS Heap"), WebInspector.UIString("JS Heap: %s"), "hsl(220, 90%, 43%)", Number.bytesToString);
- this._countersByName["documents"] = this.createCounter(WebInspector.UIString("Documents"), WebInspector.UIString("Documents: %s"), "hsl(0, 90%, 43%)");
- this._countersByName["nodes"] = this.createCounter(WebInspector.UIString("Nodes"), WebInspector.UIString("Nodes: %s"), "hsl(120, 90%, 43%)");
- this._countersByName["jsEventListeners"] = this.createCounter(WebInspector.UIString("Listeners"), WebInspector.UIString("Listeners: %s"), "hsl(38, 90%, 43%)");
- this._gpuMemoryCounter = this.createCounter(WebInspector.UIString("GPU Memory"), WebInspector.UIString("GPU Memory [KB]: %s"), "hsl(300, 90%, 43%)", Number.bytesToString);
- this._countersByName["gpuMemoryUsedKB"] = this._gpuMemoryCounter;
-};
-
-WebInspector.MemoryCountersGraph.prototype = {
- /**
- * @override
- */
- refreshRecords: function()
- {
- this.reset();
- var events = this._model.mainThreadEvents();
- for (var i = 0; i < events.length; ++i) {
- var event = events[i];
- if (event.name !== WebInspector.TimelineModel.RecordType.UpdateCounters)
- continue;
+ this._countersByName['jsHeapSizeUsed'] = this.createCounter(
+ WebInspector.UIString('JS Heap'), WebInspector.UIString('JS Heap: %s'), 'hsl(220, 90%, 43%)',
+ Number.bytesToString);
+ this._countersByName['documents'] = this.createCounter(
+ WebInspector.UIString('Documents'), WebInspector.UIString('Documents: %s'), 'hsl(0, 90%, 43%)');
+ this._countersByName['nodes'] =
+ this.createCounter(WebInspector.UIString('Nodes'), WebInspector.UIString('Nodes: %s'), 'hsl(120, 90%, 43%)');
+ this._countersByName['jsEventListeners'] = this.createCounter(
+ WebInspector.UIString('Listeners'), WebInspector.UIString('Listeners: %s'), 'hsl(38, 90%, 43%)');
+ this._gpuMemoryCounter = this.createCounter(
+ WebInspector.UIString('GPU Memory'), WebInspector.UIString('GPU Memory [KB]: %s'), 'hsl(300, 90%, 43%)',
+ Number.bytesToString);
+ this._countersByName['gpuMemoryUsedKB'] = this._gpuMemoryCounter;
+ }
- var counters = event.args.data;
- if (!counters)
- return;
- for (var name in counters) {
- var counter = this._countersByName[name];
- if (counter)
- counter.appendSample(event.startTime, counters[name]);
- }
+ /**
+ * @override
+ */
+ refreshRecords() {
+ this.reset();
+ var events = this._model.mainThreadEvents();
+ for (var i = 0; i < events.length; ++i) {
+ var event = events[i];
+ if (event.name !== WebInspector.TimelineModel.RecordType.UpdateCounters)
+ continue;
- var gpuMemoryLimitCounterName = "gpuMemoryLimitKB";
- if (gpuMemoryLimitCounterName in counters)
- this._gpuMemoryCounter.setLimit(counters[gpuMemoryLimitCounterName]);
- }
- this.scheduleRefresh();
- },
+ var counters = event.args.data;
+ if (!counters)
+ return;
+ for (var name in counters) {
+ var counter = this._countersByName[name];
+ if (counter)
+ counter.appendSample(event.startTime, counters[name]);
+ }
- __proto__: WebInspector.CountersGraph.prototype
+ var gpuMemoryLimitCounterName = 'gpuMemoryLimitKB';
+ if (gpuMemoryLimitCounterName in counters)
+ this._gpuMemoryCounter.setLimit(counters[gpuMemoryLimitCounterName]);
+ }
+ this.scheduleRefresh();
+ }
};

Powered by Google App Engine
This is Rietveld 408576698