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

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

Issue 1211613002: Timeline: check category presence in list, not string equality (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: fixed tracing-session-id.html 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) 2014 Google Inc. All rights reserved. 2 * Copyright (C) 2014 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 527 matching lines...) Expand 10 before | Expand all | Expand 10 after
538 { 538 {
539 var event = this._entryEvents[entryIndex]; 539 var event = this._entryEvents[entryIndex];
540 if (!event) 540 if (!event)
541 return this._entryIndexToFrame[entryIndex] ? "white" : "#aaa"; 541 return this._entryIndexToFrame[entryIndex] ? "white" : "#aaa";
542 if (event.name === WebInspector.TimelineModel.RecordType.JSFrame) { 542 if (event.name === WebInspector.TimelineModel.RecordType.JSFrame) {
543 var colorId = event.args["data"]["url"]; 543 var colorId = event.args["data"]["url"];
544 return this._jsFramesColorGenerator.colorForID(colorId); 544 return this._jsFramesColorGenerator.colorForID(colorId);
545 } 545 }
546 var category = WebInspector.TimelineUIUtils.eventStyle(event).category; 546 var category = WebInspector.TimelineUIUtils.eventStyle(event).category;
547 if (WebInspector.TracingModel.isAsyncPhase(event.phase)) { 547 if (WebInspector.TracingModel.isAsyncPhase(event.phase)) {
548 if (event.category === WebInspector.TracingModel.ConsoleEventCategor y) 548 if (event.hasCategory(WebInspector.TracingModel.ConsoleEventCategory ))
549 return this._consoleColorGenerator.colorForID(event.name); 549 return this._consoleColorGenerator.colorForID(event.name);
550 var color = this._asyncColorByCategory[category.name]; 550 var color = this._asyncColorByCategory[category.name];
551 if (color) 551 if (color)
552 return color; 552 return color;
553 var parsedColor = WebInspector.Color.parse(category.fillColorStop1); 553 var parsedColor = WebInspector.Color.parse(category.fillColorStop1);
554 color = parsedColor.setAlpha(0.7).asString(WebInspector.Color.Format .RGBA) || ""; 554 color = parsedColor.setAlpha(0.7).asString(WebInspector.Color.Format .RGBA) || "";
555 this._asyncColorByCategory[category.name] = color; 555 this._asyncColorByCategory[category.name] = color;
556 return color; 556 return color;
557 } 557 }
558 return category.fillColorStop1; 558 return category.fillColorStop1;
(...skipping 1016 matching lines...) Expand 10 before | Expand all | Expand 10 after
1575 /** 1575 /**
1576 * @constructor 1576 * @constructor
1577 * @param {!WebInspector.TimelineSelection} selection 1577 * @param {!WebInspector.TimelineSelection} selection
1578 * @param {number} entryIndex 1578 * @param {number} entryIndex
1579 */ 1579 */
1580 WebInspector.TimelineFlameChartView.Selection = function(selection, entryIndex) 1580 WebInspector.TimelineFlameChartView.Selection = function(selection, entryIndex)
1581 { 1581 {
1582 this.timelineSelection = selection; 1582 this.timelineSelection = selection;
1583 this.entryIndex = entryIndex; 1583 this.entryIndex = entryIndex;
1584 } 1584 }
OLDNEW
« no previous file with comments | « Source/devtools/front_end/sdk/TracingModel.js ('k') | Source/devtools/front_end/timeline/TimelineModel.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698