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

Side by Side Diff: Source/devtools/front_end/TimelineOverviewPane.js

Issue 210053002: DevTools: merge MemoryStatistics.js and CountersGraph.js, extract DOMCountersGraph.js (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 9 months 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 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 { 60 {
61 this._update(); 61 this._update();
62 }, 62 },
63 63
64 onResize: function() 64 onResize: function()
65 { 65 {
66 this._update(); 66 this._update();
67 }, 67 },
68 68
69 /** 69 /**
70 * @param {!WebInspector.TimelineOverviewBase} overviewControl 70 * @param {!WebInspector.TimelineOverview} overviewControl
71 */ 71 */
72 setOverviewControl: function(overviewControl) 72 setOverviewControl: function(overviewControl)
73 { 73 {
74 if (this._overviewControl === overviewControl) 74 if (this._overviewControl === overviewControl)
75 return; 75 return;
76 76
77 var windowTimes = null; 77 var windowTimes = null;
78 78
79 if (this._overviewControl) { 79 if (this._overviewControl) {
80 windowTimes = this._overviewControl.windowTimes(this._overviewGrid.w indowLeft(), this._overviewGrid.windowRight()); 80 windowTimes = this._overviewControl.windowTimes(this._overviewGrid.w indowLeft(), this._overviewGrid.windowRight());
(...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after
291 /** 291 /**
292 * @return {number} 292 * @return {number}
293 */ 293 */
294 boundarySpan: function() 294 boundarySpan: function()
295 { 295 {
296 return this._maximumBoundary - this._minimumBoundary; 296 return this._maximumBoundary - this._minimumBoundary;
297 } 297 }
298 } 298 }
299 299
300 /** 300 /**
301 * @interface
302 */
303 WebInspector.TimelineOverview = function(model)
304 {
305 }
306
307 WebInspector.TimelineOverview.prototype = {
308 /**
309 * @param {?Element} parentElement
310 * @param {!Element=} insertBefore
311 */
312 show: function(parentElement, insertBefore) { },
313
314 update: function() { },
315
316 reset: function() { },
317
318 /**
319 * @param {number} windowLeft
320 * @param {number} windowRight
321 * @return {!{startTime: number, endTime: number}}
322 */
323 windowTimes: function(windowLeft, windowRight) { },
324
325 /**
326 * @param {number} startTime
327 * @param {number} endTime
328 * @return {!{left: number, right: number}}
329 */
330 windowBoundaries: function(startTime, endTime) { }
331 }
332
333 /**
301 * @constructor 334 * @constructor
302 * @extends {WebInspector.VBox} 335 * @extends {WebInspector.VBox}
336 * @implements {WebInspector.TimelineOverview}
303 * @param {!WebInspector.TimelineModel} model 337 * @param {!WebInspector.TimelineModel} model
304 */ 338 */
305 WebInspector.TimelineOverviewBase = function(model) 339 WebInspector.TimelineOverviewBase = function(model)
306 { 340 {
307 WebInspector.VBox.call(this); 341 WebInspector.VBox.call(this);
308 342
309 this._model = model; 343 this._model = model;
310 this._canvas = this.element.createChild("canvas", "fill"); 344 this._canvas = this.element.createChild("canvas", "fill");
311 this._context = this._canvas.getContext("2d"); 345 this._context = this._canvas.getContext("2d");
312 } 346 }
313 347
314 WebInspector.TimelineOverviewBase.prototype = { 348 WebInspector.TimelineOverviewBase.prototype = {
315 update: function() { }, 349 update: function()
316 reset: function() { }, 350 {
351 this.resetCanvas();
352 },
353
354 reset: function()
355 {
356 },
317 357
318 /** 358 /**
319 * @param {number} windowLeft 359 * @param {number} windowLeft
320 * @param {number} windowRight 360 * @param {number} windowRight
321 * @return {!{startTime: number, endTime: number}} 361 * @return {!{startTime: number, endTime: number}}
322 */ 362 */
323 windowTimes: function(windowLeft, windowRight) 363 windowTimes: function(windowLeft, windowRight)
324 { 364 {
325 var absoluteMin = this._model.minimumRecordTime(); 365 var absoluteMin = this._model.minimumRecordTime();
326 var timeSpan = this._model.maximumRecordTime() - absoluteMin; 366 var timeSpan = this._model.maximumRecordTime() - absoluteMin;
(...skipping 20 matching lines...) Expand all
347 }, 387 },
348 388
349 resetCanvas: function() 389 resetCanvas: function()
350 { 390 {
351 this._canvas.width = this.element.clientWidth * window.devicePixelRatio; 391 this._canvas.width = this.element.clientWidth * window.devicePixelRatio;
352 this._canvas.height = this.element.clientHeight * window.devicePixelRati o; 392 this._canvas.height = this.element.clientHeight * window.devicePixelRati o;
353 }, 393 },
354 394
355 __proto__: WebInspector.VBox.prototype 395 __proto__: WebInspector.VBox.prototype
356 } 396 }
OLDNEW
« no previous file with comments | « Source/devtools/front_end/MemoryStatistics.js ('k') | Source/devtools/front_end/TimelinePanel.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698