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

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

Issue 2662453004: DevTools: Update network overview with two level bars. (Closed)
Patch Set: fix compile error Created 3 years, 10 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 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 /** 5 /**
6 * @implements {PerfUI.FlameChartDataProvider} 6 * @implements {PerfUI.FlameChartDataProvider}
7 * @unrestricted 7 * @unrestricted
8 */ 8 */
9 Timeline.TimelineFlameChartNetworkDataProvider = class { 9 Timeline.TimelineFlameChartNetworkDataProvider = class {
10 /** 10 /**
(...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after
291 } 291 }
292 contents.createChild('span').textContent = request.url.trimMiddle(maxURLChar s); 292 contents.createChild('span').textContent = request.url.trimMiddle(maxURLChar s);
293 return element; 293 return element;
294 } 294 }
295 295
296 /** 296 /**
297 * @param {string} priority 297 * @param {string} priority
298 * @return {?string} 298 * @return {?string}
299 */ 299 */
300 _colorForPriority(priority) { 300 _colorForPriority(priority) {
301 switch (/** @type {!Protocol.Network.ResourcePriority} */ (priority)) { 301 if (!this._priorityToValue) {
302 case Protocol.Network.ResourcePriority.VeryLow: 302 var priorities = Protocol.Network.ResourcePriority;
303 return '#080'; 303 this._priorityToValue = new Map([
304 case Protocol.Network.ResourcePriority.Low: 304 [priorities.VeryLow, 1],
305 return '#6c0'; 305 [priorities.Low, 2],
306 case Protocol.Network.ResourcePriority.Medium: 306 [priorities.Medium, 3],
307 return '#fa0'; 307 [priorities.High, 4],
308 case Protocol.Network.ResourcePriority.High: 308 [priorities.VeryHigh, 5]]);
309 return '#f60';
310 case Protocol.Network.ResourcePriority.VeryHigh:
311 return '#f00';
312 } 309 }
313 return null; 310 var value = this._priorityToValue.get(priority);
311 return value ? `hsla(214, 80%, 50%, ${value / 5})` : null;
314 } 312 }
315 313
316 /** 314 /**
317 * @param {!Array.<!SDK.TracingModel.Event>} events 315 * @param {!Array.<!SDK.TracingModel.Event>} events
318 */ 316 */
319 _appendTimelineData(events) { 317 _appendTimelineData(events) {
320 this._minimumBoundary = this._model.minimumRecordTime(); 318 this._minimumBoundary = this._model.minimumRecordTime();
321 this._maximumBoundary = this._model.maximumRecordTime(); 319 this._maximumBoundary = this._model.maximumRecordTime();
322 this._timeSpan = this._model.isEmpty() ? 1000 : this._maximumBoundary - this ._minimumBoundary; 320 this._timeSpan = this._model.isEmpty() ? 1000 : this._maximumBoundary - this ._minimumBoundary;
323 this._model.networkRequests().forEach(this._appendEntry.bind(this)); 321 this._model.networkRequests().forEach(this._appendEntry.bind(this));
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
382 380
383 /** 381 /**
384 * @override 382 * @override
385 * @param {number} entryIndex 383 * @param {number} entryIndex
386 * @return {boolean} 384 * @return {boolean}
387 */ 385 */
388 canJumpToEntry(entryIndex) { 386 canJumpToEntry(entryIndex) {
389 return false; 387 return false;
390 } 388 }
391 }; 389 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698