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

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

Issue 1807193003: Show v8.parseOnBackground in DevTools Timeline (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: incorporated caseq's comment Created 4 years, 9 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/TimelineModel.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 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 eventStyles[recordTypes.CompositeLayers] = new WebInspector.TimelineRecordSt yle(WebInspector.UIString("Composite Layers"), categories["painting"]); 83 eventStyles[recordTypes.CompositeLayers] = new WebInspector.TimelineRecordSt yle(WebInspector.UIString("Composite Layers"), categories["painting"]);
84 eventStyles[recordTypes.ParseHTML] = new WebInspector.TimelineRecordStyle(We bInspector.UIString("Parse HTML"), categories["loading"]); 84 eventStyles[recordTypes.ParseHTML] = new WebInspector.TimelineRecordStyle(We bInspector.UIString("Parse HTML"), categories["loading"]);
85 eventStyles[recordTypes.ParseAuthorStyleSheet] = new WebInspector.TimelineRe cordStyle(WebInspector.UIString("Parse Stylesheet"), categories["loading"]); 85 eventStyles[recordTypes.ParseAuthorStyleSheet] = new WebInspector.TimelineRe cordStyle(WebInspector.UIString("Parse Stylesheet"), categories["loading"]);
86 eventStyles[recordTypes.TimerInstall] = new WebInspector.TimelineRecordStyle (WebInspector.UIString("Install Timer"), categories["scripting"]); 86 eventStyles[recordTypes.TimerInstall] = new WebInspector.TimelineRecordStyle (WebInspector.UIString("Install Timer"), categories["scripting"]);
87 eventStyles[recordTypes.TimerRemove] = new WebInspector.TimelineRecordStyle( WebInspector.UIString("Remove Timer"), categories["scripting"]); 87 eventStyles[recordTypes.TimerRemove] = new WebInspector.TimelineRecordStyle( WebInspector.UIString("Remove Timer"), categories["scripting"]);
88 eventStyles[recordTypes.TimerFire] = new WebInspector.TimelineRecordStyle(We bInspector.UIString("Timer Fired"), categories["scripting"]); 88 eventStyles[recordTypes.TimerFire] = new WebInspector.TimelineRecordStyle(We bInspector.UIString("Timer Fired"), categories["scripting"]);
89 eventStyles[recordTypes.XHRReadyStateChange] = new WebInspector.TimelineReco rdStyle(WebInspector.UIString("XHR Ready State Change"), categories["scripting"] ); 89 eventStyles[recordTypes.XHRReadyStateChange] = new WebInspector.TimelineReco rdStyle(WebInspector.UIString("XHR Ready State Change"), categories["scripting"] );
90 eventStyles[recordTypes.XHRLoad] = new WebInspector.TimelineRecordStyle(WebI nspector.UIString("XHR Load"), categories["scripting"]); 90 eventStyles[recordTypes.XHRLoad] = new WebInspector.TimelineRecordStyle(WebI nspector.UIString("XHR Load"), categories["scripting"]);
91 eventStyles[recordTypes.CompileScript] = new WebInspector.TimelineRecordStyl e(WebInspector.UIString("Compile Script"), categories["scripting"]); 91 eventStyles[recordTypes.CompileScript] = new WebInspector.TimelineRecordStyl e(WebInspector.UIString("Compile Script"), categories["scripting"]);
92 eventStyles[recordTypes.EvaluateScript] = new WebInspector.TimelineRecordSty le(WebInspector.UIString("Evaluate Script"), categories["scripting"]); 92 eventStyles[recordTypes.EvaluateScript] = new WebInspector.TimelineRecordSty le(WebInspector.UIString("Evaluate Script"), categories["scripting"]);
93 eventStyles[recordTypes.ParseScriptOnBackground] = new WebInspector.Timeline RecordStyle(WebInspector.UIString("Parse Script"), categories["scripting"]);
93 eventStyles[recordTypes.MarkLoad] = new WebInspector.TimelineRecordStyle(Web Inspector.UIString("Load event"), categories["scripting"], true); 94 eventStyles[recordTypes.MarkLoad] = new WebInspector.TimelineRecordStyle(Web Inspector.UIString("Load event"), categories["scripting"], true);
94 eventStyles[recordTypes.MarkDOMContent] = new WebInspector.TimelineRecordSty le(WebInspector.UIString("DOMContentLoaded event"), categories["scripting"], tru e); 95 eventStyles[recordTypes.MarkDOMContent] = new WebInspector.TimelineRecordSty le(WebInspector.UIString("DOMContentLoaded event"), categories["scripting"], tru e);
95 eventStyles[recordTypes.MarkFirstPaint] = new WebInspector.TimelineRecordSty le(WebInspector.UIString("First paint"), categories["painting"], true); 96 eventStyles[recordTypes.MarkFirstPaint] = new WebInspector.TimelineRecordSty le(WebInspector.UIString("First paint"), categories["painting"], true);
96 eventStyles[recordTypes.TimeStamp] = new WebInspector.TimelineRecordStyle(We bInspector.UIString("Timestamp"), categories["scripting"]); 97 eventStyles[recordTypes.TimeStamp] = new WebInspector.TimelineRecordStyle(We bInspector.UIString("Timestamp"), categories["scripting"]);
97 eventStyles[recordTypes.ConsoleTime] = new WebInspector.TimelineRecordStyle( WebInspector.UIString("Console Time"), categories["scripting"]); 98 eventStyles[recordTypes.ConsoleTime] = new WebInspector.TimelineRecordStyle( WebInspector.UIString("Console Time"), categories["scripting"]);
98 eventStyles[recordTypes.UserTiming] = new WebInspector.TimelineRecordStyle(W ebInspector.UIString("User Timing"), categories["scripting"]); 99 eventStyles[recordTypes.UserTiming] = new WebInspector.TimelineRecordStyle(W ebInspector.UIString("User Timing"), categories["scripting"]);
99 eventStyles[recordTypes.ResourceSendRequest] = new WebInspector.TimelineReco rdStyle(WebInspector.UIString("Send Request"), categories["loading"]); 100 eventStyles[recordTypes.ResourceSendRequest] = new WebInspector.TimelineReco rdStyle(WebInspector.UIString("Send Request"), categories["loading"]);
100 eventStyles[recordTypes.ResourceReceiveResponse] = new WebInspector.Timeline RecordStyle(WebInspector.UIString("Receive Response"), categories["loading"]); 101 eventStyles[recordTypes.ResourceReceiveResponse] = new WebInspector.Timeline RecordStyle(WebInspector.UIString("Receive Response"), categories["loading"]);
101 eventStyles[recordTypes.ResourceFinish] = new WebInspector.TimelineRecordSty le(WebInspector.UIString("Finish Loading"), categories["loading"]); 102 eventStyles[recordTypes.ResourceFinish] = new WebInspector.TimelineRecordSty le(WebInspector.UIString("Finish Loading"), categories["loading"]);
102 eventStyles[recordTypes.ResourceReceivedData] = new WebInspector.TimelineRec ordStyle(WebInspector.UIString("Receive Data"), categories["loading"]); 103 eventStyles[recordTypes.ResourceReceivedData] = new WebInspector.TimelineRec ordStyle(WebInspector.UIString("Receive Data"), categories["loading"]);
(...skipping 281 matching lines...) Expand 10 before | Expand all | Expand 10 after
384 case recordType.ParseHTML: 385 case recordType.ParseHTML:
385 var endLine = event.args["endData"] && event.args["endData"]["endLine"]; 386 var endLine = event.args["endData"] && event.args["endData"]["endLine"];
386 var url = WebInspector.displayNameForURL(event.args["beginData"]["url"]) ; 387 var url = WebInspector.displayNameForURL(event.args["beginData"]["url"]) ;
387 detailsText = WebInspector.UIString("%s [%s\u2026%s]", url, event.args[" beginData"]["startLine"] + 1, endLine >= 0 ? endLine + 1 : ""); 388 detailsText = WebInspector.UIString("%s [%s\u2026%s]", url, event.args[" beginData"]["startLine"] + 1, endLine >= 0 ? endLine + 1 : "");
388 break; 389 break;
389 390
390 case recordType.CompileScript: 391 case recordType.CompileScript:
391 case recordType.EvaluateScript: 392 case recordType.EvaluateScript:
392 var url = eventData["url"]; 393 var url = eventData["url"];
393 if (url) 394 if (url)
394 detailsText = detailsText = WebInspector.displayNameForURL(url) + ": " + eventData["lineNumber"]; 395 detailsText = WebInspector.displayNameForURL(url) + ":" + eventData[ "lineNumber"];
395 break; 396 break;
397 case recordType.ParseScriptOnBackground:
396 case recordType.XHRReadyStateChange: 398 case recordType.XHRReadyStateChange:
397 case recordType.XHRLoad: 399 case recordType.XHRLoad:
398 var url = eventData["url"]; 400 var url = eventData["url"];
399 if (url) 401 if (url)
400 detailsText = detailsText = WebInspector.displayNameForURL(url); 402 detailsText = WebInspector.displayNameForURL(url);
401 break; 403 break;
402 404
403 case recordType.WebSocketCreate: 405 case recordType.WebSocketCreate:
404 case recordType.WebSocketSendHandshakeRequest: 406 case recordType.WebSocketSendHandshakeRequest:
405 case recordType.WebSocketReceiveHandshakeResponse: 407 case recordType.WebSocketReceiveHandshakeResponse:
406 case recordType.WebSocketDestroy: 408 case recordType.WebSocketDestroy:
407 case recordType.ResourceSendRequest: 409 case recordType.ResourceSendRequest:
408 case recordType.ResourceReceivedData: 410 case recordType.ResourceReceivedData:
409 case recordType.ResourceReceiveResponse: 411 case recordType.ResourceReceiveResponse:
410 case recordType.ResourceFinish: 412 case recordType.ResourceFinish:
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
533 details.createTextChild(" @ "); 535 details.createTextChild(" @ ");
534 details.appendChild(location); 536 details.appendChild(location);
535 } 537 }
536 break; 538 break;
537 case recordType.CompileScript: 539 case recordType.CompileScript:
538 case recordType.EvaluateScript: 540 case recordType.EvaluateScript:
539 var url = eventData["url"]; 541 var url = eventData["url"];
540 if (url) 542 if (url)
541 details = linkifyLocation("", url, eventData["lineNumber"], 0); 543 details = linkifyLocation("", url, eventData["lineNumber"], 0);
542 break; 544 break;
545 case recordType.ParseScriptOnBackground:
546 var url = eventData["url"];
547 if (url)
548 details = linkifyLocation("", url, 0, 0);
549 break;
543 default: 550 default:
544 if (event.hasCategory(WebInspector.TimelineModel.Category.Console)) 551 if (event.hasCategory(WebInspector.TimelineModel.Category.Console))
545 detailsText = null; 552 detailsText = null;
546 else 553 else
547 details = linkifyTopCallFrame(); 554 details = linkifyTopCallFrame();
548 break; 555 break;
549 } 556 }
550 557
551 if (!details && detailsText) 558 if (!details && detailsText)
552 details = createTextNode(detailsText); 559 details = createTextNode(detailsText);
(...skipping 1609 matching lines...) Expand 10 before | Expand all | Expand 10 after
2162 var time = /** @type {number} */ (decoration.data()); 2169 var time = /** @type {number} */ (decoration.data());
2163 var text = WebInspector.UIString("%.1f\xa0ms", time); 2170 var text = WebInspector.UIString("%.1f\xa0ms", time);
2164 var intensity = Number.constrain(Math.log10(1 + 2 * time) / 5, 0.02, 1); 2171 var intensity = Number.constrain(Math.log10(1 + 2 * time) / 5, 0.02, 1);
2165 var element = createElementWithClass("div", "text-editor-line-marker -performance"); 2172 var element = createElementWithClass("div", "text-editor-line-marker -performance");
2166 element.textContent = text; 2173 element.textContent = text;
2167 element.style.backgroundColor = `hsla(44, 100%, 50%, ${intensity.toF ixed(3)})`; 2174 element.style.backgroundColor = `hsla(44, 100%, 50%, ${intensity.toF ixed(3)})`;
2168 textEditor.setGutterDecoration(decoration.line(), decoration.type(), element); 2175 textEditor.setGutterDecoration(decoration.line(), decoration.type(), element);
2169 } 2176 }
2170 } 2177 }
2171 } 2178 }
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/devtools/front_end/timeline/TimelineModel.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698