Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 Loading... | |
| 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 Loading... | |
| 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 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 527 details.createTextChild(" @ "); | 529 details.createTextChild(" @ "); |
| 528 details.appendChild(location); | 530 details.appendChild(location); |
| 529 } | 531 } |
| 530 break; | 532 break; |
| 531 case recordType.CompileScript: | 533 case recordType.CompileScript: |
| 532 case recordType.EvaluateScript: | 534 case recordType.EvaluateScript: |
| 533 var url = eventData["url"]; | 535 var url = eventData["url"]; |
| 534 if (url) | 536 if (url) |
| 535 details = linkifyLocation("", url, eventData["lineNumber"], 0); | 537 details = linkifyLocation("", url, eventData["lineNumber"], 0); |
| 536 break; | 538 break; |
| 539 case recordType.ParseScriptOnBackground: | |
|
alph
2016/03/19 03:14:38
nit: you can merge it with the previous cases.
horo
2016/03/23 07:06:05
Done.
| |
| 540 var url = eventData["url"]; | |
| 541 if (url) | |
| 542 details = linkifyLocation("", url, 0, 0); | |
|
caseq
2016/03/18 23:36:04
nit: drop line/column numbers, these are default p
horo
2016/03/23 07:06:05
Fixed WebInspector.linkifyResourceAsNode().
| |
| 543 break; | |
| 537 default: | 544 default: |
| 538 if (event.hasCategory(WebInspector.TimelineModel.Category.Console)) | 545 if (event.hasCategory(WebInspector.TimelineModel.Category.Console)) |
| 539 detailsText = null; | 546 detailsText = null; |
| 540 else | 547 else |
| 541 details = linkifyTopCallFrame(); | 548 details = linkifyTopCallFrame(); |
| 542 break; | 549 break; |
| 543 } | 550 } |
| 544 | 551 |
| 545 if (!details && detailsText) | 552 if (!details && detailsText) |
| 546 details = createTextNode(detailsText); | 553 details = createTextNode(detailsText); |
| (...skipping 1579 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2126 for (var decoration of decorations) { | 2133 for (var decoration of decorations) { |
| 2127 var time = /** @type {number} */ (decoration.data()); | 2134 var time = /** @type {number} */ (decoration.data()); |
| 2128 var text = WebInspector.UIString("%.1f\xa0ms", time); | 2135 var text = WebInspector.UIString("%.1f\xa0ms", time); |
| 2129 var intensity = Number.constrain(Math.log10(1 + 2 * time) / 5, 0.02, 1); | 2136 var intensity = Number.constrain(Math.log10(1 + 2 * time) / 5, 0.02, 1); |
| 2130 var element = createElementWithClass("div", "text-editor-line-marker -performance"); | 2137 var element = createElementWithClass("div", "text-editor-line-marker -performance"); |
| 2131 element.textContent = text; | 2138 element.textContent = text; |
| 2132 element.style.backgroundColor = `rgba(255, 0, 0, ${intensity.toFixed (3)})`; | 2139 element.style.backgroundColor = `rgba(255, 0, 0, ${intensity.toFixed (3)})`; |
| 2133 textEditor.setGutterDecoration(decoration.line(), decoration.type(), element); | 2140 textEditor.setGutterDecoration(decoration.line(), decoration.type(), element); |
| 2134 } | 2141 } |
| 2135 } | 2142 } |
| 2136 } | 2143 } |
| OLD | NEW |