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

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/timeline/TimelineEventOverview.js

Issue 2466123002: DevTools: reformat front-end code to match chromium style. (Closed)
Patch Set: 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
95 }, 95 },
96 96
97 __proto__: WebInspector.TimelineOverviewBase.prototype 97 __proto__: WebInspector.TimelineOverviewBase.prototype
98 }; 98 };
99 99
100 /** 100 /**
101 * @constructor 101 * @constructor
102 * @extends {WebInspector.TimelineEventOverview} 102 * @extends {WebInspector.TimelineEventOverview}
103 * @param {!WebInspector.TimelineModel} model 103 * @param {!WebInspector.TimelineModel} model
104 */ 104 */
105 WebInspector.TimelineEventOverview.Input = function(model) 105 WebInspector.TimelineEventOverviewInput = function(model)
106 { 106 {
107 WebInspector.TimelineEventOverview.call(this, "input", null, model); 107 WebInspector.TimelineEventOverview.call(this, "input", null, model);
108 }; 108 };
109 109
110 WebInspector.TimelineEventOverview.Input.prototype = { 110 WebInspector.TimelineEventOverviewInput.prototype = {
111 /** 111 /**
112 * @override 112 * @override
113 */ 113 */
114 update: function() 114 update: function()
115 { 115 {
116 WebInspector.TimelineEventOverview.prototype.update.call(this); 116 WebInspector.TimelineEventOverview.prototype.update.call(this);
117 var events = this._model.mainThreadEvents(); 117 var events = this._model.mainThreadEvents();
118 var height = this._canvas.height; 118 var height = this._canvas.height;
119 var descriptors = WebInspector.TimelineUIUtils.eventDispatchDesciptors() ; 119 var descriptors = WebInspector.TimelineUIUtils.eventDispatchDesciptors() ;
120 /** @type {!Map.<string,!WebInspector.TimelineUIUtils.EventDispatchTypeD escriptor>} */ 120 /** @type {!Map.<string,!WebInspector.TimelineUIUtils.EventDispatchTypeD escriptor>} */
(...skipping 28 matching lines...) Expand all
149 }, 149 },
150 150
151 __proto__: WebInspector.TimelineEventOverview.prototype 151 __proto__: WebInspector.TimelineEventOverview.prototype
152 }; 152 };
153 153
154 /** 154 /**
155 * @constructor 155 * @constructor
156 * @extends {WebInspector.TimelineEventOverview} 156 * @extends {WebInspector.TimelineEventOverview}
157 * @param {!WebInspector.TimelineModel} model 157 * @param {!WebInspector.TimelineModel} model
158 */ 158 */
159 WebInspector.TimelineEventOverview.Network = function(model) 159 WebInspector.TimelineEventOverviewNetwork = function(model)
160 { 160 {
161 WebInspector.TimelineEventOverview.call(this, "network", WebInspector.UIStri ng("NET"), model); 161 WebInspector.TimelineEventOverview.call(this, "network", WebInspector.UIStri ng("NET"), model);
162 }; 162 };
163 163
164 WebInspector.TimelineEventOverview.Network.prototype = { 164 WebInspector.TimelineEventOverviewNetwork.prototype = {
165 /** 165 /**
166 * @override 166 * @override
167 */ 167 */
168 update: function() 168 update: function()
169 { 169 {
170 WebInspector.TimelineEventOverview.prototype.update.call(this); 170 WebInspector.TimelineEventOverview.prototype.update.call(this);
171 var height = this._canvas.height; 171 var height = this._canvas.height;
172 var numBands = categoryBand(WebInspector.TimelineUIUtils.NetworkCategory .Other) + 1; 172 var numBands = categoryBand(WebInspector.TimelineUIUtils.NetworkCategory .Other) + 1;
173 var bandHeight = Math.floor(height / numBands); 173 var bandHeight = Math.floor(height / numBands);
174 var devicePixelRatio = window.devicePixelRatio; 174 var devicePixelRatio = window.devicePixelRatio;
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
232 }, 232 },
233 233
234 __proto__: WebInspector.TimelineEventOverview.prototype 234 __proto__: WebInspector.TimelineEventOverview.prototype
235 }; 235 };
236 236
237 /** 237 /**
238 * @constructor 238 * @constructor
239 * @extends {WebInspector.TimelineEventOverview} 239 * @extends {WebInspector.TimelineEventOverview}
240 * @param {!WebInspector.TimelineModel} model 240 * @param {!WebInspector.TimelineModel} model
241 */ 241 */
242 WebInspector.TimelineEventOverview.CPUActivity = function(model) 242 WebInspector.TimelineEventOverviewCPUActivity = function(model)
243 { 243 {
244 WebInspector.TimelineEventOverview.call(this, "cpu-activity", WebInspector.U IString("CPU"), model); 244 WebInspector.TimelineEventOverview.call(this, "cpu-activity", WebInspector.U IString("CPU"), model);
245 this._backgroundCanvas = this.element.createChild("canvas", "fill background "); 245 this._backgroundCanvas = this.element.createChild("canvas", "fill background ");
246 }; 246 };
247 247
248 WebInspector.TimelineEventOverview.CPUActivity.prototype = { 248 WebInspector.TimelineEventOverviewCPUActivity.prototype = {
249 /** 249 /**
250 * @override 250 * @override
251 */ 251 */
252 resetCanvas: function() 252 resetCanvas: function()
253 { 253 {
254 WebInspector.TimelineEventOverview.prototype.resetCanvas.call(this); 254 WebInspector.TimelineEventOverview.prototype.resetCanvas.call(this);
255 this._backgroundCanvas.width = this.element.clientWidth * window.deviceP ixelRatio; 255 this._backgroundCanvas.width = this.element.clientWidth * window.deviceP ixelRatio;
256 this._backgroundCanvas.height = this.element.clientHeight * window.devic ePixelRatio; 256 this._backgroundCanvas.height = this.element.clientHeight * window.devic ePixelRatio;
257 }, 257 },
258 258
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
363 363
364 __proto__: WebInspector.TimelineEventOverview.prototype 364 __proto__: WebInspector.TimelineEventOverview.prototype
365 }; 365 };
366 366
367 /** 367 /**
368 * @constructor 368 * @constructor
369 * @extends {WebInspector.TimelineEventOverview} 369 * @extends {WebInspector.TimelineEventOverview}
370 * @param {!WebInspector.TimelineModel} model 370 * @param {!WebInspector.TimelineModel} model
371 * @param {!WebInspector.TimelineFrameModel} frameModel 371 * @param {!WebInspector.TimelineFrameModel} frameModel
372 */ 372 */
373 WebInspector.TimelineEventOverview.Responsiveness = function(model, frameModel) 373 WebInspector.TimelineEventOverviewResponsiveness = function(model, frameModel)
374 { 374 {
375 WebInspector.TimelineEventOverview.call(this, "responsiveness", null, model) ; 375 WebInspector.TimelineEventOverview.call(this, "responsiveness", null, model) ;
376 this._frameModel = frameModel; 376 this._frameModel = frameModel;
377 }; 377 };
378 378
379 WebInspector.TimelineEventOverview.Responsiveness.prototype = { 379 WebInspector.TimelineEventOverviewResponsiveness.prototype = {
380 /** 380 /**
381 * @override 381 * @override
382 */ 382 */
383 update: function() 383 update: function()
384 { 384 {
385 WebInspector.TimelineEventOverview.prototype.update.call(this); 385 WebInspector.TimelineEventOverview.prototype.update.call(this);
386 var height = this._canvas.height; 386 var height = this._canvas.height;
387 var timeOffset = this._model.minimumRecordTime(); 387 var timeOffset = this._model.minimumRecordTime();
388 var timeSpan = this._model.maximumRecordTime() - timeOffset; 388 var timeSpan = this._model.maximumRecordTime() - timeOffset;
389 var scale = this._canvas.width / timeSpan; 389 var scale = this._canvas.width / timeSpan;
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after
595 595
596 __proto__: WebInspector.TimelineEventOverview.prototype 596 __proto__: WebInspector.TimelineEventOverview.prototype
597 }; 597 };
598 598
599 /** 599 /**
600 * @constructor 600 * @constructor
601 * @extends {WebInspector.TimelineEventOverview} 601 * @extends {WebInspector.TimelineEventOverview}
602 * @param {!WebInspector.TimelineModel} model 602 * @param {!WebInspector.TimelineModel} model
603 * @param {!WebInspector.TimelineFrameModel} frameModel 603 * @param {!WebInspector.TimelineFrameModel} frameModel
604 */ 604 */
605 WebInspector.TimelineEventOverview.Frames = function(model, frameModel) 605 WebInspector.TimelineEventOverviewFrames = function(model, frameModel)
606 { 606 {
607 WebInspector.TimelineEventOverview.call(this, "framerate", WebInspector.UISt ring("FPS"), model); 607 WebInspector.TimelineEventOverview.call(this, "framerate", WebInspector.UISt ring("FPS"), model);
608 this._frameModel = frameModel; 608 this._frameModel = frameModel;
609 }; 609 };
610 610
611 WebInspector.TimelineEventOverview.Frames.prototype = { 611 WebInspector.TimelineEventOverviewFrames.prototype = {
612 /** 612 /**
613 * @override 613 * @override
614 */ 614 */
615 update: function() 615 update: function()
616 { 616 {
617 WebInspector.TimelineEventOverview.prototype.update.call(this); 617 WebInspector.TimelineEventOverview.prototype.update.call(this);
618 var height = this._canvas.height; 618 var height = this._canvas.height;
619 var /** @const */ padding = 1 * window.devicePixelRatio; 619 var /** @const */ padding = 1 * window.devicePixelRatio;
620 var /** @const */ baseFrameDurationMs = 1e3 / 60; 620 var /** @const */ baseFrameDurationMs = 1e3 / 60;
621 var visualHeight = height - 2 * padding; 621 var visualHeight = height - 2 * padding;
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
658 }, 658 },
659 659
660 __proto__: WebInspector.TimelineEventOverview.prototype 660 __proto__: WebInspector.TimelineEventOverview.prototype
661 }; 661 };
662 662
663 /** 663 /**
664 * @constructor 664 * @constructor
665 * @extends {WebInspector.TimelineEventOverview} 665 * @extends {WebInspector.TimelineEventOverview}
666 * @param {!WebInspector.TimelineModel} model 666 * @param {!WebInspector.TimelineModel} model
667 */ 667 */
668 WebInspector.TimelineEventOverview.Memory = function(model) 668 WebInspector.TimelineEventOverviewMemory = function(model)
669 { 669 {
670 WebInspector.TimelineEventOverview.call(this, "memory", WebInspector.UIStrin g("HEAP"), model); 670 WebInspector.TimelineEventOverview.call(this, "memory", WebInspector.UIStrin g("HEAP"), model);
671 this._heapSizeLabel = this.element.createChild("div", "memory-graph-label"); 671 this._heapSizeLabel = this.element.createChild("div", "memory-graph-label");
672 }; 672 };
673 673
674 WebInspector.TimelineEventOverview.Memory.prototype = { 674 WebInspector.TimelineEventOverviewMemory.prototype = {
675 resetHeapSizeLabels: function() 675 resetHeapSizeLabels: function()
676 { 676 {
677 this._heapSizeLabel.textContent = ""; 677 this._heapSizeLabel.textContent = "";
678 }, 678 },
679 679
680 /** 680 /**
681 * @override 681 * @override
682 */ 682 */
683 update: function() 683 update: function()
684 { 684 {
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
818 counters[group] = this._quantDuration; 818 counters[group] = this._quantDuration;
819 this._callback(counters); 819 this._callback(counters);
820 interval -= this._quantDuration; 820 interval -= this._quantDuration;
821 } 821 }
822 this._counters = []; 822 this._counters = [];
823 this._counters[group] = interval; 823 this._counters[group] = interval;
824 this._lastTime = time; 824 this._lastTime = time;
825 this._remainder = this._quantDuration - interval; 825 this._remainder = this._quantDuration - interval;
826 } 826 }
827 }; 827 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698