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

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/ui_lazy/TimelineGrid.js

Issue 2418623002: [Devtools] Added divider timing to network timeline expirement (Closed)
Patch Set: [Devtools] Added divider timeing to network timeline expirement Created 4 years, 2 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) 2007, 2008 Apple Inc. All rights reserved. 2 * Copyright (C) 2007, 2008 Apple Inc. All rights reserved.
3 * Copyright (C) 2008, 2009 Anthony Ricaud <rik@webkit.org> 3 * Copyright (C) 2008, 2009 Anthony Ricaud <rik@webkit.org>
4 * Copyright (C) 2009 Google Inc. All rights reserved. 4 * Copyright (C) 2009 Google Inc. All rights reserved.
5 * 5 *
6 * Redistribution and use in source and binary forms, with or without 6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions 7 * modification, are permitted provided that the following conditions
8 * are met: 8 * are met:
9 * 9 *
10 * 1. Redistributions of source code must retain the above copyright 10 * 1. Redistributions of source code must retain the above copyright
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 this._rightCurtainElement = this.element.createChild("div", "timeline-curtai n-right"); 48 this._rightCurtainElement = this.element.createChild("div", "timeline-curtai n-right");
49 } 49 }
50 50
51 /** 51 /**
52 * @param {!WebInspector.TimelineGrid.Calculator} calculator 52 * @param {!WebInspector.TimelineGrid.Calculator} calculator
53 * @param {number=} freeZoneAtLeft 53 * @param {number=} freeZoneAtLeft
54 * @return {!{offsets: !Array.<number>, precision: number}} 54 * @return {!{offsets: !Array.<number>, precision: number}}
55 */ 55 */
56 WebInspector.TimelineGrid.calculateDividerOffsets = function(calculator, freeZon eAtLeft) 56 WebInspector.TimelineGrid.calculateDividerOffsets = function(calculator, freeZon eAtLeft)
57 { 57 {
58 // TODO(allada) Remove this code out when timeline canvas experiment is over .
58 /** @const */ var minGridSlicePx = 64; // minimal distance between grid line s. 59 /** @const */ var minGridSlicePx = 64; // minimal distance between grid line s.
59 60
60 var clientWidth = calculator.computePosition(calculator.maximumBoundary()); 61 var clientWidth = calculator.computePosition(calculator.maximumBoundary());
61 var dividersCount = clientWidth / minGridSlicePx; 62 var dividersCount = clientWidth / minGridSlicePx;
62 var gridSliceTime = calculator.boundarySpan() / dividersCount; 63 var gridSliceTime = calculator.boundarySpan() / dividersCount;
63 var pixelsPerTime = clientWidth / calculator.boundarySpan(); 64 var pixelsPerTime = clientWidth / calculator.boundarySpan();
64 65
65 // Align gridSliceTime to a nearest round value. 66 // Align gridSliceTime to a nearest round value.
66 // We allow spans that fit into the formula: span = (1|2|5)x10^n, 67 // We allow spans that fit into the formula: span = (1|2|5)x10^n,
67 // e.g.: ... .1 .2 .5 1 2 5 10 20 50 ... 68 // e.g.: ... .1 .2 .5 1 2 5 10 20 50 ...
(...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after
330 331
331 /** @return {number} */ 332 /** @return {number} */
332 zeroTime: function() { }, 333 zeroTime: function() { },
333 334
334 /** @return {number} */ 335 /** @return {number} */
335 maximumBoundary: function() { }, 336 maximumBoundary: function() { },
336 337
337 /** @return {number} */ 338 /** @return {number} */
338 boundarySpan: function() { } 339 boundarySpan: function() { }
339 } 340 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698