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

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

Issue 1410153009: DevTools: Make network events continuous on Timeline (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 1 month 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 /* 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 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
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.MarkLoad] = new WebInspector.TimelineRecordStyle(Web Inspector.UIString("Load event"), categories["scripting"], true); 93 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); 94 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); 95 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"]); 96 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"]); 97 eventStyles[recordTypes.ConsoleTime] = new WebInspector.TimelineRecordStyle( WebInspector.UIString("Console Time"), categories["scripting"]);
98 eventStyles[recordTypes.ResourceSendRequest] = new WebInspector.TimelineReco rdStyle(WebInspector.UIString("Send Request"), categories["loading"]); 98 eventStyles[recordTypes.ResourceFetcherRequestResource] = new WebInspector.T imelineRecordStyle(WebInspector.UIString("Send Request"), categories["loading"]) ;
99 eventStyles[recordTypes.ResourceReceiveResponse] = new WebInspector.Timeline RecordStyle(WebInspector.UIString("Receive Response"), categories["loading"]); 99 eventStyles[recordTypes.ResourceDispatcherOnReceivedResponse] = new WebInspe ctor.TimelineRecordStyle(WebInspector.UIString("Receive Response"), categories[" loading"]);
100 eventStyles[recordTypes.ResourceFinish] = new WebInspector.TimelineRecordSty le(WebInspector.UIString("Finish Loading"), categories["loading"]); 100 eventStyles[recordTypes.ResourceDispatcherOnRequestComplete] = new WebInspec tor.TimelineRecordStyle(WebInspector.UIString("Request Complete"), categories["l oading"]);
101 eventStyles[recordTypes.ResourceReceivedData] = new WebInspector.TimelineRec ordStyle(WebInspector.UIString("Receive Data"), categories["loading"]); 101 eventStyles[recordTypes.ResourceDispatcherOnReceivedData] = new WebInspector .TimelineRecordStyle(WebInspector.UIString("Receive Data"), categories["loading" ]);
102 eventStyles[recordTypes.FunctionCall] = new WebInspector.TimelineRecordStyle (WebInspector.UIString("Function Call"), categories["scripting"]); 102 eventStyles[recordTypes.FunctionCall] = new WebInspector.TimelineRecordStyle (WebInspector.UIString("Function Call"), categories["scripting"]);
103 eventStyles[recordTypes.GCEvent] = new WebInspector.TimelineRecordStyle(WebI nspector.UIString("GC Event"), categories["scripting"]); 103 eventStyles[recordTypes.GCEvent] = new WebInspector.TimelineRecordStyle(WebI nspector.UIString("GC Event"), categories["scripting"]);
104 eventStyles[recordTypes.MajorGC] = new WebInspector.TimelineRecordStyle(WebI nspector.UIString("Major GC"), categories["scripting"]); 104 eventStyles[recordTypes.MajorGC] = new WebInspector.TimelineRecordStyle(WebI nspector.UIString("Major GC"), categories["scripting"]);
105 eventStyles[recordTypes.MinorGC] = new WebInspector.TimelineRecordStyle(WebI nspector.UIString("Minor GC"), categories["scripting"]); 105 eventStyles[recordTypes.MinorGC] = new WebInspector.TimelineRecordStyle(WebI nspector.UIString("Minor GC"), categories["scripting"]);
106 eventStyles[recordTypes.JSFrame] = new WebInspector.TimelineRecordStyle(WebI nspector.UIString("JS Frame"), categories["scripting"]); 106 eventStyles[recordTypes.JSFrame] = new WebInspector.TimelineRecordStyle(WebI nspector.UIString("JS Frame"), categories["scripting"]);
107 eventStyles[recordTypes.RequestAnimationFrame] = new WebInspector.TimelineRe cordStyle(WebInspector.UIString("Request Animation Frame"), categories["scriptin g"]); 107 eventStyles[recordTypes.RequestAnimationFrame] = new WebInspector.TimelineRe cordStyle(WebInspector.UIString("Request Animation Frame"), categories["scriptin g"]);
108 eventStyles[recordTypes.CancelAnimationFrame] = new WebInspector.TimelineRec ordStyle(WebInspector.UIString("Cancel Animation Frame"), categories["scripting" ]); 108 eventStyles[recordTypes.CancelAnimationFrame] = new WebInspector.TimelineRec ordStyle(WebInspector.UIString("Cancel Animation Frame"), categories["scripting" ]);
109 eventStyles[recordTypes.FireAnimationFrame] = new WebInspector.TimelineRecor dStyle(WebInspector.UIString("Animation Frame Fired"), categories["scripting"]); 109 eventStyles[recordTypes.FireAnimationFrame] = new WebInspector.TimelineRecor dStyle(WebInspector.UIString("Animation Frame Fired"), categories["scripting"]);
110 eventStyles[recordTypes.RequestIdleCallback] = new WebInspector.TimelineReco rdStyle(WebInspector.UIString("Request Idle Callback"), categories["scripting"]) ; 110 eventStyles[recordTypes.RequestIdleCallback] = new WebInspector.TimelineReco rdStyle(WebInspector.UIString("Request Idle Callback"), categories["scripting"]) ;
111 eventStyles[recordTypes.CancelIdleCallback] = new WebInspector.TimelineRecor dStyle(WebInspector.UIString("Cancel Idle Callback"), categories["scripting"]); 111 eventStyles[recordTypes.CancelIdleCallback] = new WebInspector.TimelineRecor dStyle(WebInspector.UIString("Cancel Idle Callback"), categories["scripting"]);
(...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after
339 case recordType.XHRLoad: 339 case recordType.XHRLoad:
340 var url = eventData["url"]; 340 var url = eventData["url"];
341 if (url) 341 if (url)
342 detailsText = detailsText = WebInspector.displayNameForURL(url); 342 detailsText = detailsText = WebInspector.displayNameForURL(url);
343 break; 343 break;
344 344
345 case recordType.WebSocketCreate: 345 case recordType.WebSocketCreate:
346 case recordType.WebSocketSendHandshakeRequest: 346 case recordType.WebSocketSendHandshakeRequest:
347 case recordType.WebSocketReceiveHandshakeResponse: 347 case recordType.WebSocketReceiveHandshakeResponse:
348 case recordType.WebSocketDestroy: 348 case recordType.WebSocketDestroy:
349 case recordType.ResourceSendRequest: 349 case recordType.ResourceFetcherRequestResource:
350 case recordType.ResourceReceivedData: 350 case recordType.ResourceDispatcherOnReceivedData:
351 case recordType.ResourceReceiveResponse: 351 case recordType.ResourceDispatcherOnReceivedResponse:
352 case recordType.ResourceFinish: 352 case recordType.ResourceDispatcherOnRequestComplete:
353 case recordType.PaintImage: 353 case recordType.PaintImage:
354 case recordType.DecodeImage: 354 case recordType.DecodeImage:
355 case recordType.ResizeImage: 355 case recordType.ResizeImage:
356 case recordType.DecodeLazyPixelRef: 356 case recordType.DecodeLazyPixelRef:
357 if (event.url) 357 if (event.url)
358 detailsText = WebInspector.displayNameForURL(event.url); 358 detailsText = WebInspector.displayNameForURL(event.url);
359 break; 359 break;
360 360
361 case recordType.EmbedderCallback: 361 case recordType.EmbedderCallback:
362 detailsText = eventData["callbackName"]; 362 detailsText = eventData["callbackName"];
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
437 case recordType.WebSocketReceiveHandshakeResponse: 437 case recordType.WebSocketReceiveHandshakeResponse:
438 case recordType.WebSocketDestroy: 438 case recordType.WebSocketDestroy:
439 detailsText = WebInspector.TimelineUIUtils.buildDetailsTextForTraceEvent (event, target); 439 detailsText = WebInspector.TimelineUIUtils.buildDetailsTextForTraceEvent (event, target);
440 break; 440 break;
441 case recordType.PaintImage: 441 case recordType.PaintImage:
442 case recordType.DecodeImage: 442 case recordType.DecodeImage:
443 case recordType.ResizeImage: 443 case recordType.ResizeImage:
444 case recordType.DecodeLazyPixelRef: 444 case recordType.DecodeLazyPixelRef:
445 case recordType.XHRReadyStateChange: 445 case recordType.XHRReadyStateChange:
446 case recordType.XHRLoad: 446 case recordType.XHRLoad:
447 case recordType.ResourceSendRequest: 447 case recordType.ResourceFetcherRequestResource:
448 case recordType.ResourceReceivedData: 448 case recordType.ResourceDispatcherOnReceivedData:
449 case recordType.ResourceReceiveResponse: 449 case recordType.ResourceDispatcherOnReceivedResponse:
450 case recordType.ResourceFinish: 450 case recordType.ResourceDispatcherOnRequestComplete:
451 if (event.url) 451 if (event.url)
452 details = WebInspector.linkifyResourceAsNode(event.url); 452 details = WebInspector.linkifyResourceAsNode(event.url);
453 break; 453 break;
454 case recordType.FunctionCall: 454 case recordType.FunctionCall:
455 details = linkifyLocation(eventData["scriptId"], eventData["scriptName"] , eventData["scriptLine"], 0); 455 details = linkifyLocation(eventData["scriptId"], eventData["scriptName"] , eventData["scriptLine"], 0);
456 break; 456 break;
457 case recordType.JSFrame: 457 case recordType.JSFrame:
458 details = createElement("span"); 458 details = createElement("span");
459 details.createTextChild(WebInspector.beautifyFunctionName(eventData["fun ctionName"])); 459 details.createTextChild(WebInspector.beautifyFunctionName(eventData["fun ctionName"]));
460 var location = linkifyLocation(eventData["scriptId"], eventData["url"], eventData["lineNumber"], eventData["columnNumber"]); 460 var location = linkifyLocation(eventData["scriptId"], eventData["url"], eventData["lineNumber"], eventData["columnNumber"]);
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after
622 contentHelper.appendTextRow(WebInspector.UIString("Repeats"), !event Data["singleShot"]); 622 contentHelper.appendTextRow(WebInspector.UIString("Repeats"), !event Data["singleShot"]);
623 } 623 }
624 break; 624 break;
625 case recordTypes.FireAnimationFrame: 625 case recordTypes.FireAnimationFrame:
626 contentHelper.appendTextRow(WebInspector.UIString("Callback ID"), eventD ata["id"]); 626 contentHelper.appendTextRow(WebInspector.UIString("Callback ID"), eventD ata["id"]);
627 break; 627 break;
628 case recordTypes.FunctionCall: 628 case recordTypes.FunctionCall:
629 if (eventData["scriptName"]) 629 if (eventData["scriptName"])
630 contentHelper.appendLocationRow(WebInspector.UIString("Location"), e ventData["scriptName"], eventData["scriptLine"]); 630 contentHelper.appendLocationRow(WebInspector.UIString("Location"), e ventData["scriptName"], eventData["scriptLine"]);
631 break; 631 break;
632 case recordTypes.ResourceSendRequest: 632 case recordTypes.ResourceFetcherRequestResource:
633 case recordTypes.ResourceReceiveResponse: 633 case recordTypes.ResourceDispatcherOnReceivedData:
634 case recordTypes.ResourceReceivedData: 634 case recordTypes.ResourceDispatcherOnReceivedResponse:
635 case recordTypes.ResourceFinish: 635 case recordTypes.ResourceDispatcherOnRequestComplete:
636 var url = (event.name === recordTypes.ResourceSendRequest) ? eventData[" url"] : initiator && initiator.args["data"]["url"]; 636 var url = (event.name === recordTypes.ResourceFetcherRequestResource) ? eventData["url"] : initiator && initiator.args["data"]["url"];
637 if (url) 637 if (url)
638 contentHelper.appendElementRow(WebInspector.UIString("Resource"), We bInspector.linkifyResourceAsNode(url)); 638 contentHelper.appendElementRow(WebInspector.UIString("Resource"), We bInspector.linkifyResourceAsNode(url));
639 if (eventData["requestMethod"]) 639 if (eventData["requestMethod"])
640 contentHelper.appendTextRow(WebInspector.UIString("Request Method"), eventData["requestMethod"]); 640 contentHelper.appendTextRow(WebInspector.UIString("Request Method"), eventData["requestMethod"]);
641 if (typeof eventData["statusCode"] === "number") 641 if (typeof eventData["statusCode"] === "number")
642 contentHelper.appendTextRow(WebInspector.UIString("Status Code"), ev entData["statusCode"]); 642 contentHelper.appendTextRow(WebInspector.UIString("Status Code"), ev entData["statusCode"]);
643 if (eventData["mimeType"]) 643 if (eventData["mimeType"])
644 contentHelper.appendTextRow(WebInspector.UIString("MIME Type"), even tData["mimeType"]); 644 contentHelper.appendTextRow(WebInspector.UIString("MIME Type"), even tData["mimeType"]);
645 if (eventData["encodedDataLength"]) 645 if (eventData["encodedDataLength"])
646 contentHelper.appendTextRow(WebInspector.UIString("Encoded Data Leng th"), WebInspector.UIString("%d Bytes", eventData["encodedDataLength"])); 646 contentHelper.appendTextRow(WebInspector.UIString("Encoded Data Leng th"), WebInspector.UIString("%d Bytes", eventData["encodedDataLength"]));
(...skipping 301 matching lines...) Expand 10 before | Expand all | Expand 10 after
948 callSiteStackLabel = WebInspector.UIString("First layout invalidation"); 948 callSiteStackLabel = WebInspector.UIString("First layout invalidation");
949 stackLabel = WebInspector.UIString("Layout forced"); 949 stackLabel = WebInspector.UIString("Layout forced");
950 break; 950 break;
951 } 951 }
952 952
953 // Direct cause. 953 // Direct cause.
954 if (event.stackTrace) 954 if (event.stackTrace)
955 contentHelper.appendStackTrace(stackLabel || WebInspector.UIString("Stac k trace"), event.stackTrace); 955 contentHelper.appendStackTrace(stackLabel || WebInspector.UIString("Stac k trace"), event.stackTrace);
956 956
957 // Indirect causes. 957 // Indirect causes.
958 if (event.invalidationTrackingEvents && target) { // Full invalidation track ing (experimental). 958 if (event.invalidationTrackingEvents && target) // Full invalidation trackin g (experimental).
959 WebInspector.TimelineUIUtils._generateInvalidations(event, target, conte ntHelper); 959 WebInspector.TimelineUIUtils._generateInvalidations(event, target, conte ntHelper);
960 } else if (initiator && initiator.stackTrace) { // Partial invalidation trac king. 960 else if (initiator && initiator.stackTrace) // Partial invalidation tracking .
961 contentHelper.appendStackTrace(callSiteStackLabel || WebInspector.UIStri ng("First invalidated"), initiator.stackTrace); 961 contentHelper.appendStackTrace(callSiteStackLabel || WebInspector.UIStri ng("First invalidated"), initiator.stackTrace);
962 }
963 } 962 }
964 963
965 /** 964 /**
966 * @param {!WebInspector.TracingModel.Event} event 965 * @param {!WebInspector.TracingModel.Event} event
967 * @param {!WebInspector.Target} target 966 * @param {!WebInspector.Target} target
968 * @param {!WebInspector.TimelineDetailsContentHelper} contentHelper 967 * @param {!WebInspector.TimelineDetailsContentHelper} contentHelper
969 */ 968 */
970 WebInspector.TimelineUIUtils._generateInvalidations = function(event, target, co ntentHelper) 969 WebInspector.TimelineUIUtils._generateInvalidations = function(event, target, co ntentHelper)
971 { 970 {
972 if (!event.invalidationTrackingEvents) 971 if (!event.invalidationTrackingEvents)
(...skipping 1085 matching lines...) Expand 10 before | Expand all | Expand 10 after
2058 WebInspector.UIString("Not optimized"), undefined, true)); 2057 WebInspector.UIString("Not optimized"), undefined, true));
2059 span.createTextChild(WebInspector.UIString(": %s", eventData["deoptR eason"])); 2058 span.createTextChild(WebInspector.UIString(": %s", eventData["deoptR eason"]));
2060 break; 2059 break;
2061 default: 2060 default:
2062 console.assert(false, "Unhandled TimelineModel.WarningType"); 2061 console.assert(false, "Unhandled TimelineModel.WarningType");
2063 } 2062 }
2064 2063
2065 this.appendElementRow(WebInspector.UIString("Warning"), span, true); 2064 this.appendElementRow(WebInspector.UIString("Warning"), span, true);
2066 } 2065 }
2067 } 2066 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698