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

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

Issue 305133004: Eliminate url() method on TimelineModel.Record (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 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
« no previous file with comments | « 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 532 matching lines...) Expand 10 before | Expand all | Expand 10 after
543 contentHelper.appendTextRow(WebInspector.UIString("Callback ID"), re cordData["id"]); 543 contentHelper.appendTextRow(WebInspector.UIString("Callback ID"), re cordData["id"]);
544 break; 544 break;
545 case recordTypes.FunctionCall: 545 case recordTypes.FunctionCall:
546 if (recordData["scriptName"]) 546 if (recordData["scriptName"])
547 contentHelper.appendLocationRow(WebInspector.UIString("Location" ), recordData["scriptName"], recordData["scriptLine"]); 547 contentHelper.appendLocationRow(WebInspector.UIString("Location" ), recordData["scriptName"], recordData["scriptLine"]);
548 break; 548 break;
549 case recordTypes.ResourceSendRequest: 549 case recordTypes.ResourceSendRequest:
550 case recordTypes.ResourceReceiveResponse: 550 case recordTypes.ResourceReceiveResponse:
551 case recordTypes.ResourceReceivedData: 551 case recordTypes.ResourceReceivedData:
552 case recordTypes.ResourceFinish: 552 case recordTypes.ResourceFinish:
553 var url = record.url(); 553 var url;
554 if (record.type() === recordTypes.ResourceSendRequest)
555 url = recordData["url"];
556 else if (record.initiator())
557 url = record.initiator().data()["url"];
554 if (url) 558 if (url)
555 contentHelper.appendElementRow(WebInspector.UIString("Resource") , WebInspector.linkifyResourceAsNode(url)); 559 contentHelper.appendElementRow(WebInspector.UIString("Resource") , WebInspector.linkifyResourceAsNode(url));
556 if (imagePreviewElement) 560 if (imagePreviewElement)
557 contentHelper.appendElementRow(WebInspector.UIString("Preview"), imagePreviewElement); 561 contentHelper.appendElementRow(WebInspector.UIString("Preview"), imagePreviewElement);
558 if (recordData["requestMethod"]) 562 if (recordData["requestMethod"])
559 contentHelper.appendTextRow(WebInspector.UIString("Request Metho d"), recordData["requestMethod"]); 563 contentHelper.appendTextRow(WebInspector.UIString("Request Metho d"), recordData["requestMethod"]);
560 if (typeof recordData["statusCode"] === "number") 564 if (typeof recordData["statusCode"] === "number")
561 contentHelper.appendTextRow(WebInspector.UIString("Status Code") , recordData["statusCode"]); 565 contentHelper.appendTextRow(WebInspector.UIString("Status Code") , recordData["statusCode"]);
562 if (recordData["mimeType"]) 566 if (recordData["mimeType"])
563 contentHelper.appendTextRow(WebInspector.UIString("MIME Type"), recordData["mimeType"]); 567 contentHelper.appendTextRow(WebInspector.UIString("MIME Type"), recordData["mimeType"]);
(...skipping 14 matching lines...) Expand all
578 // Fall-through intended. 582 // Fall-through intended.
579 583
580 case recordTypes.PaintSetup: 584 case recordTypes.PaintSetup:
581 case recordTypes.Rasterize: 585 case recordTypes.Rasterize:
582 case recordTypes.ScrollLayer: 586 case recordTypes.ScrollLayer:
583 relatedNodeLabel = WebInspector.UIString("Layer root"); 587 relatedNodeLabel = WebInspector.UIString("Layer root");
584 break; 588 break;
585 case recordTypes.DecodeImage: 589 case recordTypes.DecodeImage:
586 case recordTypes.ResizeImage: 590 case recordTypes.ResizeImage:
587 relatedNodeLabel = WebInspector.UIString("Image element"); 591 relatedNodeLabel = WebInspector.UIString("Image element");
588 var url = record.url(); 592 var url = recordData["url"];
589 if (url) 593 if (url)
590 contentHelper.appendElementRow(WebInspector.UIString("Image URL" ), WebInspector.linkifyResourceAsNode(url)); 594 contentHelper.appendElementRow(WebInspector.UIString("Image URL" ), WebInspector.linkifyResourceAsNode(url));
591 break; 595 break;
592 case recordTypes.RecalculateStyles: // We don't want to see default deta ils. 596 case recordTypes.RecalculateStyles: // We don't want to see default deta ils.
593 if (recordData["elementCount"]) 597 if (recordData["elementCount"])
594 contentHelper.appendTextRow(WebInspector.UIString("Elements affe cted"), recordData["elementCount"]); 598 contentHelper.appendTextRow(WebInspector.UIString("Elements affe cted"), recordData["elementCount"]);
595 callStackLabel = WebInspector.UIString("Styles recalculation forced" ); 599 callStackLabel = WebInspector.UIString("Styles recalculation forced" );
596 break; 600 break;
597 case recordTypes.Layout: 601 case recordTypes.Layout:
598 if (recordData["dirtyObjects"]) 602 if (recordData["dirtyObjects"])
(...skipping 383 matching lines...) Expand 10 before | Expand all | Expand 10 after
982 details = linkifyTopCallFrame(); 986 details = linkifyTopCallFrame();
983 break; 987 break;
984 case WebInspector.TimelineModel.RecordType.EvaluateScript: 988 case WebInspector.TimelineModel.RecordType.EvaluateScript:
985 var url = recordData["url"]; 989 var url = recordData["url"];
986 if (url) 990 if (url)
987 details = linkifyLocation("", url, recordData["lineNumber"], 0); 991 details = linkifyLocation("", url, recordData["lineNumber"], 0);
988 break; 992 break;
989 case WebInspector.TimelineModel.RecordType.XHRReadyStateChange: 993 case WebInspector.TimelineModel.RecordType.XHRReadyStateChange:
990 case WebInspector.TimelineModel.RecordType.XHRLoad: 994 case WebInspector.TimelineModel.RecordType.XHRLoad:
991 case WebInspector.TimelineModel.RecordType.ResourceSendRequest: 995 case WebInspector.TimelineModel.RecordType.ResourceSendRequest:
996 case WebInspector.TimelineModel.RecordType.DecodeImage:
997 case WebInspector.TimelineModel.RecordType.ResizeImage:
998 var url = recordData["url"];
999 if (url)
1000 detailsText = WebInspector.displayNameForURL(url);
1001 break;
992 case WebInspector.TimelineModel.RecordType.ResourceReceivedData: 1002 case WebInspector.TimelineModel.RecordType.ResourceReceivedData:
993 case WebInspector.TimelineModel.RecordType.ResourceReceiveResponse: 1003 case WebInspector.TimelineModel.RecordType.ResourceReceiveResponse:
994 case WebInspector.TimelineModel.RecordType.ResourceFinish: 1004 case WebInspector.TimelineModel.RecordType.ResourceFinish:
995 case WebInspector.TimelineModel.RecordType.DecodeImage: 1005 var initiator = record.initiator();
996 case WebInspector.TimelineModel.RecordType.ResizeImage: 1006 if (initiator) {
997 var url = record.url(); 1007 var url = initiator.data()["url"];
998 if (url) 1008 if (url)
999 detailsText = WebInspector.displayNameForURL(url); 1009 detailsText = WebInspector.displayNameForURL(url);
1010 }
1000 break; 1011 break;
1001 case WebInspector.TimelineModel.RecordType.ConsoleTime: 1012 case WebInspector.TimelineModel.RecordType.ConsoleTime:
1002 detailsText = recordData["message"]; 1013 detailsText = recordData["message"];
1003 break; 1014 break;
1004 case WebInspector.TimelineModel.RecordType.EmbedderCallback: 1015 case WebInspector.TimelineModel.RecordType.EmbedderCallback:
1005 detailsText = recordData["callbackName"]; 1016 detailsText = recordData["callbackName"];
1006 break; 1017 break;
1007 default: 1018 default:
1008 details = linkifyTopCallFrame(); 1019 details = linkifyTopCallFrame();
1009 break; 1020 break;
(...skipping 375 matching lines...) Expand 10 before | Expand all | Expand 10 after
1385 for (var i = 0; i < stackTrace.length; ++i) { 1396 for (var i = 0; i < stackTrace.length; ++i) {
1386 var stackFrame = stackTrace[i]; 1397 var stackFrame = stackTrace[i];
1387 var row = stackTraceElement.createChild("div"); 1398 var row = stackTraceElement.createChild("div");
1388 row.createTextChild(stackFrame.functionName || WebInspector.UIString ("(anonymous function)")); 1399 row.createTextChild(stackFrame.functionName || WebInspector.UIString ("(anonymous function)"));
1389 row.createTextChild(" @ "); 1400 row.createTextChild(" @ ");
1390 var urlElement = this._linkifier.linkifyLocation(this._target, stack Frame.url, stackFrame.lineNumber - 1); 1401 var urlElement = this._linkifier.linkifyLocation(this._target, stack Frame.url, stackFrame.lineNumber - 1);
1391 row.appendChild(urlElement); 1402 row.appendChild(urlElement);
1392 } 1403 }
1393 } 1404 }
1394 } 1405 }
OLDNEW
« no previous file with comments | « 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