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

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

Issue 416843002: DevTools: Send async stack trace with Network.Initiator. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: 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 | Annotate | Revision Log
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 994 matching lines...) Expand 10 before | Expand all | Expand 10 after
1005 { 1005 {
1006 this._linkifier.reset(); 1006 this._linkifier.reset();
1007 }, 1007 },
1008 1008
1009 /** 1009 /**
1010 * @param {!WebInspector.NetworkRequest} request 1010 * @param {!WebInspector.NetworkRequest} request
1011 * @return {!Element} 1011 * @return {!Element}
1012 */ 1012 */
1013 _generateScriptInitiatedPopoverContent: function(request) 1013 _generateScriptInitiatedPopoverContent: function(request)
1014 { 1014 {
1015 var stackTrace = request.initiator.stackTrace;
1016 var framesTable = document.createElement("table"); 1015 var framesTable = document.createElement("table");
1017 for (var i = 0; i < stackTrace.length; ++i) { 1016
1018 var stackFrame = stackTrace[i]; 1017 /**
1019 var row = document.createElement("tr"); 1018 * @param {!Array.<!ConsoleAgent.CallFrame>} stackTrace
1020 row.createChild("td").textContent = stackFrame.functionName || WebIn spector.UIString("(anonymous function)"); 1019 * @this {WebInspector.NetworkLogView}
1021 row.createChild("td").textContent = " @ "; 1020 */
1022 row.createChild("td").appendChild(this._linkifier.linkifyLocation(re quest.target(), stackFrame.url, stackFrame.lineNumber - 1, stackFrame.columnNumb er - 1)); 1021 function appendStackTrace(stackTrace)
1023 framesTable.appendChild(row); 1022 {
1023 for (var i = 0; i < stackTrace.length; ++i) {
1024 var stackFrame = stackTrace[i];
1025 var row = document.createElement("tr");
1026 row.createChild("td").textContent = stackFrame.functionName || W ebInspector.UIString("(anonymous function)");
1027 row.createChild("td").textContent = " @ ";
1028 row.createChild("td").appendChild(this._linkifier.linkifyLocatio n(request.target(), stackFrame.url, stackFrame.lineNumber - 1, stackFrame.column Number - 1));
1029 framesTable.appendChild(row);
1030 }
1024 } 1031 }
1032
1033 appendStackTrace.call(this, request.initiator.stackTrace);
1034
1035 var asyncStackTrace = request.initiator.asyncStackTrace;
1036 for (; asyncStackTrace; asyncStackTrace = asyncStackTrace.asyncStackTrac e) {
eustas 2014/07/24 13:47:01 may be use "while"?
aandrey 2014/07/24 13:51:12 Done.
1037 var callFrames = asyncStackTrace.callFrames;
1038 if (!callFrames || !callFrames.length)
1039 break;
1040 var row = framesTable.createChild("tr");
1041 row.createChild("td", "network-async-trace-description").textContent = WebInspector.asyncStackTraceLabel(asyncStackTrace.description);
1042 row.createChild("td");
1043 row.createChild("td");
1044 appendStackTrace.call(this, callFrames);
1045 }
1046
1025 return framesTable; 1047 return framesTable;
1026 }, 1048 },
1027 1049
1028 _updateColumns: function() 1050 _updateColumns: function()
1029 { 1051 {
1030 var detailedMode = !!this._detailedMode; 1052 var detailedMode = !!this._detailedMode;
1031 var visibleColumns = {"name": true}; 1053 var visibleColumns = {"name": true};
1032 if (detailedMode) { 1054 if (detailedMode) {
1033 visibleColumns["timeline"] = true; 1055 visibleColumns["timeline"] = true;
1034 var columnsVisibility = this._coulmnsVisibilitySetting.get(); 1056 var columnsVisibility = this._coulmnsVisibilitySetting.get();
(...skipping 1982 matching lines...) Expand 10 before | Expand all | Expand 10 after
3017 WebInspector.NetworkDataGridNode.RequestPropertyComparator = function(propertyNa me, revert, a, b) 3039 WebInspector.NetworkDataGridNode.RequestPropertyComparator = function(propertyNa me, revert, a, b)
3018 { 3040 {
3019 var aValue = a._request[propertyName]; 3041 var aValue = a._request[propertyName];
3020 var bValue = b._request[propertyName]; 3042 var bValue = b._request[propertyName];
3021 if (aValue > bValue) 3043 if (aValue > bValue)
3022 return revert ? -1 : 1; 3044 return revert ? -1 : 1;
3023 if (bValue > aValue) 3045 if (bValue > aValue)
3024 return revert ? 1 : -1; 3046 return revert ? 1 : -1;
3025 return a._request.indentityCompare(b._request); 3047 return a._request.indentityCompare(b._request);
3026 } 3048 }
OLDNEW
« no previous file with comments | « Source/devtools/front_end/console/ConsoleViewMessage.js ('k') | Source/devtools/front_end/networkLogView.css » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698