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

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

Issue 2882343002: DevTools: Make flamechart coloring depend on group by selector. (Closed)
Patch Set: . Created 3 years, 7 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
« no previous file with comments | « third_party/WebKit/Source/devtools/front_end/timeline/TimelineTreeView.js ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 Google Inc. All rights reserved.
3 * Copyright (C) 2012 Intel Inc. All rights reserved. 3 * Copyright (C) 2012 Intel Inc. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are 6 * modification, are permitted provided that the following conditions are
7 * met: 7 * met:
8 * 8 *
9 * * Redistributions of source code must retain the above copyright 9 * * Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after
273 else if (type === 'number') 273 else if (type === 'number')
274 tokens.push(String(value)); 274 tokens.push(String(value));
275 else if (type === 'object') 275 else if (type === 'object')
276 appendObjectProperties(value, depth - 1); 276 appendObjectProperties(value, depth - 1);
277 } 277 }
278 } 278 }
279 } 279 }
280 280
281 /** 281 /**
282 * @param {!SDK.TracingModel.Event} event 282 * @param {!SDK.TracingModel.Event} event
283 * @return {?string}
284 */
285 static eventURL(event) {
286 var data = event.args['data'] || event.args['beginData'];
287 var url = data && data.url;
288 if (url)
289 return url;
290 var stackTrace = data && data['stackTrace'];
291 var frame =
292 stackTrace && stackTrace.length && stackTrace[0] || TimelineModel.Timeli neData.forEvent(event).topFrame();
293 return frame && frame.url || null;
294 }
295
296 /**
297 * @param {!SDK.TracingModel.Event} event
283 * @return {!{title: string, category: !Timeline.TimelineCategory}} 298 * @return {!{title: string, category: !Timeline.TimelineCategory}}
284 */ 299 */
285 static eventStyle(event) { 300 static eventStyle(event) {
286 var eventStyles = Timeline.TimelineUIUtils._initEventStyles(); 301 var eventStyles = Timeline.TimelineUIUtils._initEventStyles();
287 if (event.hasCategory(TimelineModel.TimelineModel.Category.Console) || 302 if (event.hasCategory(TimelineModel.TimelineModel.Category.Console) ||
288 event.hasCategory(TimelineModel.TimelineModel.Category.UserTiming)) 303 event.hasCategory(TimelineModel.TimelineModel.Category.UserTiming))
289 return {title: event.name, category: Timeline.TimelineUIUtils.categories() ['scripting']}; 304 return {title: event.name, category: Timeline.TimelineUIUtils.categories() ['scripting']};
290 305
291 if (event.hasCategory(TimelineModel.TimelineModel.Category.LatencyInfo)) { 306 if (event.hasCategory(TimelineModel.TimelineModel.Category.LatencyInfo)) {
292 /** @const */ 307 /** @const */
(...skipping 895 matching lines...) Expand 10 before | Expand all | Expand 10 after
1188 // Direct cause. 1203 // Direct cause.
1189 if (timelineData.stackTrace && timelineData.stackTrace.length) { 1204 if (timelineData.stackTrace && timelineData.stackTrace.length) {
1190 contentHelper.addSection(Common.UIString('Call Stacks')); 1205 contentHelper.addSection(Common.UIString('Call Stacks'));
1191 contentHelper.appendStackTrace( 1206 contentHelper.appendStackTrace(
1192 stackLabel || Common.UIString('Stack Trace'), 1207 stackLabel || Common.UIString('Stack Trace'),
1193 Timeline.TimelineUIUtils._stackTraceFromCallFrames(timelineData.stackT race)); 1208 Timeline.TimelineUIUtils._stackTraceFromCallFrames(timelineData.stackT race));
1194 } 1209 }
1195 1210
1196 var initiator = TimelineModel.TimelineData.forEvent(event).initiator(); 1211 var initiator = TimelineModel.TimelineData.forEvent(event).initiator();
1197 // Indirect causes. 1212 // Indirect causes.
1198 if (TimelineModel.InvalidationTracker.invalidationEventsFor(event) && 1213 if (TimelineModel.InvalidationTracker.invalidationEventsFor(event) && target ) {
1199 target) { // Full invalidation tracking (experimental). 1214 // Full invalidation tracking (experimental).
1200 contentHelper.addSection(Common.UIString('Invalidations')); 1215 contentHelper.addSection(Common.UIString('Invalidations'));
1201 Timeline.TimelineUIUtils._generateInvalidations(event, target, relatedNode sMap, contentHelper); 1216 Timeline.TimelineUIUtils._generateInvalidations(event, target, relatedNode sMap, contentHelper);
1202 } else if (initiator) { // Partial invalidation tracking. 1217 } else if (initiator) { // Partial invalidation tracking.
1203 var delay = event.startTime - initiator.startTime; 1218 var delay = event.startTime - initiator.startTime;
1204 contentHelper.appendTextRow(Common.UIString('Pending for'), Number.precise MillisToString(delay, 1)); 1219 contentHelper.appendTextRow(Common.UIString('Pending for'), Number.precise MillisToString(delay, 1));
1205 1220
1206 var link = createElementWithClass('span', 'devtools-link'); 1221 var link = createElementWithClass('span', 'devtools-link');
1207 link.textContent = Common.UIString('reveal'); 1222 link.textContent = Common.UIString('reveal');
1208 link.addEventListener('click', () => { 1223 link.addEventListener('click', () => {
1209 Timeline.TimelinePanel.instance().select( 1224 Timeline.TimelinePanel.instance().select(
(...skipping 1060 matching lines...) Expand 10 before | Expand all | Expand 10 after
2270 * @param {string=} warningType 2285 * @param {string=} warningType
2271 */ 2286 */
2272 appendWarningRow(event, warningType) { 2287 appendWarningRow(event, warningType) {
2273 var warning = Timeline.TimelineUIUtils.eventWarning(event, warningType); 2288 var warning = Timeline.TimelineUIUtils.eventWarning(event, warningType);
2274 if (warning) 2289 if (warning)
2275 this.appendElementRow(Common.UIString('Warning'), warning, true); 2290 this.appendElementRow(Common.UIString('Warning'), warning, true);
2276 } 2291 }
2277 }; 2292 };
2278 2293
2279 Timeline.TimelineUIUtils._categoryBreakdownCacheSymbol = Symbol('categoryBreakdo wnCache'); 2294 Timeline.TimelineUIUtils._categoryBreakdownCacheSymbol = Symbol('categoryBreakdo wnCache');
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/devtools/front_end/timeline/TimelineTreeView.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698