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

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

Issue 1178563002: DevTools: Refactor network panel overview (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: update test. Created 5 years, 6 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 | Annotate | Revision Log
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 18 matching lines...) Expand all
29 */ 29 */
30 30
31 /** 31 /**
32 * @constructor 32 * @constructor
33 * @extends {WebInspector.TimelineOverviewBase} 33 * @extends {WebInspector.TimelineOverviewBase}
34 * @param {!WebInspector.TimelineModel} model 34 * @param {!WebInspector.TimelineModel} model
35 * @param {!WebInspector.TimelineFrameModelBase} frameModel 35 * @param {!WebInspector.TimelineFrameModelBase} frameModel
36 */ 36 */
37 WebInspector.TimelineEventOverview = function(model, frameModel) 37 WebInspector.TimelineEventOverview = function(model, frameModel)
38 { 38 {
39 WebInspector.TimelineOverviewBase.call(this, model); 39 WebInspector.TimelineOverviewBase.call(this);
40 this.element.id = "timeline-overview-events"; 40 this.element.id = "timeline-overview-events";
41 this._model = model;
41 this._frameModel = frameModel; 42 this._frameModel = frameModel;
42 43
43 this._fillStyles = {}; 44 this._fillStyles = {};
44 var categories = WebInspector.TimelineUIUtils.categories(); 45 var categories = WebInspector.TimelineUIUtils.categories();
45 for (var category in categories) { 46 for (var category in categories) {
46 this._fillStyles[category] = categories[category].fillColorStop1; 47 this._fillStyles[category] = categories[category].fillColorStop1;
47 categories[category].addEventListener(WebInspector.TimelineCategory.Even ts.VisibilityChanged, this._onCategoryVisibilityChanged, this); 48 categories[category].addEventListener(WebInspector.TimelineCategory.Even ts.VisibilityChanged, this._onCategoryVisibilityChanged, this);
48 } 49 }
49 50
50 this._disabledCategoryFillStyle = "hsl(0, 0%, 67%)"; 51 this._disabledCategoryFillStyle = "hsl(0, 0%, 67%)";
(...skipping 328 matching lines...) Expand 10 before | Expand all | Expand 10 after
379 */ 380 */
380 _renderBar: function(begin, end, position, height, color) 381 _renderBar: function(begin, end, position, height, color)
381 { 382 {
382 var x = begin; 383 var x = begin;
383 var y = position * window.devicePixelRatio; 384 var y = position * window.devicePixelRatio;
384 var width = end - begin; 385 var width = end - begin;
385 this._context.fillStyle = color; 386 this._context.fillStyle = color;
386 this._context.fillRect(x, y, width, height * window.devicePixelRatio); 387 this._context.fillRect(x, y, width, height * window.devicePixelRatio);
387 }, 388 },
388 389
390 /**
391 * @override
392 * @param {number} windowLeft
393 * @param {number} windowRight
394 * @return {!{startTime: number, endTime: number}}
395 */
396 windowTimes: function(windowLeft, windowRight)
397 {
398 var absoluteMin = this._model.minimumRecordTime();
399 var timeSpan = this._model.maximumRecordTime() - absoluteMin;
400 return {
401 startTime: absoluteMin + timeSpan * windowLeft,
402 endTime: absoluteMin + timeSpan * windowRight
403 };
404 },
405
406 /**
407 * @override
408 * @param {number} startTime
409 * @param {number} endTime
410 * @return {!{left: number, right: number}}
411 */
412 windowBoundaries: function(startTime, endTime)
413 {
414 var absoluteMin = this._model.minimumRecordTime();
415 var timeSpan = this._model.maximumRecordTime() - absoluteMin;
416 var haveRecords = absoluteMin > 0;
417 return {
418 left: haveRecords && startTime ? Math.min((startTime - absoluteMin) / timeSpan, 1) : 0,
419 right: haveRecords && endTime < Infinity ? (endTime - absoluteMin) / timeSpan : 1
420 };
421 },
422
389 __proto__: WebInspector.TimelineOverviewBase.prototype 423 __proto__: WebInspector.TimelineOverviewBase.prototype
390 } 424 }
391 425
392 /** 426 /**
393 * @constructor 427 * @constructor
394 * @template T 428 * @template T
395 */ 429 */
396 WebInspector.Dithering = function() 430 WebInspector.Dithering = function()
397 { 431 {
398 /** @type {!Map.<?T,number>} */ 432 /** @type {!Map.<?T,number>} */
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
504 counters[group] = this._quantDuration; 538 counters[group] = this._quantDuration;
505 this._callback(counters); 539 this._callback(counters);
506 interval -= this._quantDuration; 540 interval -= this._quantDuration;
507 } 541 }
508 this._counters = []; 542 this._counters = [];
509 this._counters[group] = interval; 543 this._counters[group] = interval;
510 this._lastTime = time; 544 this._lastTime = time;
511 this._remainder = this._quantDuration - interval; 545 this._remainder = this._quantDuration - interval;
512 } 546 }
513 } 547 }
OLDNEW
« no previous file with comments | « Source/devtools/front_end/timeline/CountersGraph.js ('k') | Source/devtools/front_end/timeline/TimelineFrameOverview.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698