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

Side by Side Diff: Source/devtools/front_end/network/NetworkPanel.js

Issue 404953004: DevTools: Refactor linkifyRawLocation to use fallback url (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Address aandrey's comments Created 6 years, 4 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2007, 2008 Apple Inc. All rights reserved. 2 * Copyright (C) 2007, 2008 Apple Inc. All rights reserved.
3 * Copyright (C) 2008, 2009 Anthony Ricaud <rik@webkit.org> 3 * Copyright (C) 2008, 2009 Anthony Ricaud <rik@webkit.org>
4 * Copyright (C) 2011 Google Inc. All rights reserved. 4 * Copyright (C) 2011 Google Inc. All rights reserved.
5 * 5 *
6 * Redistribution and use in source and binary forms, with or without 6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions 7 * modification, are permitted provided that the following conditions
8 * are met: 8 * are met:
9 * 9 *
10 * 1. Redistributions of source code must retain the above copyright 10 * 1. Redistributions of source code must retain the above copyright
(...skipping 1017 matching lines...) Expand 10 before | Expand all | Expand 10 after
1028 this._linkifier.reset(); 1028 this._linkifier.reset();
1029 }, 1029 },
1030 1030
1031 /** 1031 /**
1032 * @param {!WebInspector.NetworkRequest} request 1032 * @param {!WebInspector.NetworkRequest} request
1033 * @return {!Element} 1033 * @return {!Element}
1034 */ 1034 */
1035 _generateScriptInitiatedPopoverContent: function(request) 1035 _generateScriptInitiatedPopoverContent: function(request)
1036 { 1036 {
1037 var framesTable = document.createElement("table"); 1037 var framesTable = document.createElement("table");
1038
aandrey 2014/07/30 10:01:23 nit: put back a blank line?
sergeyv 2014/07/30 13:43:01 Done.
1039 /** 1038 /**
1040 * @param {!Array.<!ConsoleAgent.CallFrame>} stackTrace 1039 * @param {!Array.<!ConsoleAgent.CallFrame>} stackTrace
1041 * @this {WebInspector.NetworkLogView} 1040 * @this {WebInspector.NetworkLogView}
1042 */ 1041 */
1043 function appendStackTrace(stackTrace) 1042 function appendStackTrace(stackTrace)
1044 { 1043 {
1045 for (var i = 0; i < stackTrace.length; ++i) { 1044 for (var i = 0; i < stackTrace.length; ++i) {
1046 var stackFrame = stackTrace[i]; 1045 var stackFrame = stackTrace[i];
1047 var rawLocation = request.target().debuggerModel.createRawLocati onByConsoleCallFrame(stackFrame);
1048 var row = document.createElement("tr"); 1046 var row = document.createElement("tr");
1049 row.createChild("td").textContent = stackFrame.functionName || W ebInspector.UIString("(anonymous function)"); 1047 row.createChild("td").textContent = stackFrame.functionName || W ebInspector.UIString("(anonymous function)");
1050 row.createChild("td").textContent = " @ "; 1048 row.createChild("td").textContent = " @ ";
1051 row.createChild("td").appendChild(this._linkifier.linkifyRawLoca tion(rawLocation)); 1049 row.createChild("td").appendChild(this._linkifier.linkifyConsole CallFrame(request.target(), stackFrame));
1052 framesTable.appendChild(row); 1050 framesTable.appendChild(row);
1053 } 1051 }
1054 } 1052 }
1055 1053
1056 appendStackTrace.call(this, request.initiator.stackTrace); 1054 appendStackTrace.call(this, request.initiator.stackTrace);
1057 1055
1058 var asyncStackTrace = request.initiator.asyncStackTrace; 1056 var asyncStackTrace = request.initiator.asyncStackTrace;
1059 while (asyncStackTrace) { 1057 while (asyncStackTrace) {
1060 var callFrames = asyncStackTrace.callFrames; 1058 var callFrames = asyncStackTrace.callFrames;
1061 if (!callFrames || !callFrames.length) 1059 if (!callFrames || !callFrames.length)
(...skipping 1705 matching lines...) Expand 10 before | Expand all | Expand 10 after
2767 case WebInspector.NetworkRequest.InitiatorType.Redirect: 2765 case WebInspector.NetworkRequest.InitiatorType.Redirect:
2768 cell.title = initiator.url; 2766 cell.title = initiator.url;
2769 console.assert(request.redirectSource); 2767 console.assert(request.redirectSource);
2770 var redirectSource = /** @type {!WebInspector.NetworkRequest} */ (re quest.redirectSource); 2768 var redirectSource = /** @type {!WebInspector.NetworkRequest} */ (re quest.redirectSource);
2771 cell.appendChild(WebInspector.linkifyRequestAsNode(redirectSource)); 2769 cell.appendChild(WebInspector.linkifyRequestAsNode(redirectSource));
2772 this._appendSubtitle(cell, WebInspector.UIString("Redirect")); 2770 this._appendSubtitle(cell, WebInspector.UIString("Redirect"));
2773 break; 2771 break;
2774 2772
2775 case WebInspector.NetworkRequest.InitiatorType.Script: 2773 case WebInspector.NetworkRequest.InitiatorType.Script:
2776 if (!this._linkifiedInitiatorAnchor) { 2774 if (!this._linkifiedInitiatorAnchor) {
2777 this._linkifiedInitiatorAnchor = this._linkifier.linkifyLocation (request.target(), initiator.url, initiator.lineNumber - 1, initiator.columnNumb er - 1); 2775 this._linkifiedInitiatorAnchor = this._linkifier.linkifyScriptLo cation(request.target(), null, initiator.url, initiator.lineNumber - 1, initiato r.columnNumber - 1);
2778 this._linkifiedInitiatorAnchor.title = ""; 2776 this._linkifiedInitiatorAnchor.title = "";
2779 } 2777 }
2780 cell.appendChild(this._linkifiedInitiatorAnchor); 2778 cell.appendChild(this._linkifiedInitiatorAnchor);
2781 this._appendSubtitle(cell, WebInspector.UIString("Script")); 2779 this._appendSubtitle(cell, WebInspector.UIString("Script"));
2782 cell.classList.add("network-script-initiated"); 2780 cell.classList.add("network-script-initiated");
2783 cell.request = request; 2781 cell.request = request;
2784 break; 2782 break;
2785 2783
2786 default: 2784 default:
2787 cell.title = ""; 2785 cell.title = "";
(...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after
3051 WebInspector.NetworkDataGridNode.RequestPropertyComparator = function(propertyNa me, revert, a, b) 3049 WebInspector.NetworkDataGridNode.RequestPropertyComparator = function(propertyNa me, revert, a, b)
3052 { 3050 {
3053 var aValue = a._request[propertyName]; 3051 var aValue = a._request[propertyName];
3054 var bValue = b._request[propertyName]; 3052 var bValue = b._request[propertyName];
3055 if (aValue > bValue) 3053 if (aValue > bValue)
3056 return revert ? -1 : 1; 3054 return revert ? -1 : 1;
3057 if (bValue > aValue) 3055 if (bValue > aValue)
3058 return revert ? 1 : -1; 3056 return revert ? 1 : -1;
3059 return a._request.indentityCompare(b._request); 3057 return a._request.indentityCompare(b._request);
3060 } 3058 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698