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

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

Issue 2151653005: DevTools: Do not linkify to pseudo (program) node when there's no URL (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: update a test expectation. Created 4 years, 5 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) 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 978 matching lines...) Expand 10 before | Expand all | Expand 10 after
989 var priority = WebInspector.uiLabelForPriority(/** @type {!NetworkAgent. ResourcePriority} */ (request.priority)); 989 var priority = WebInspector.uiLabelForPriority(/** @type {!NetworkAgent. ResourcePriority} */ (request.priority));
990 contentHelper.appendTextRow(WebInspector.UIString("Priority"), priority) ; 990 contentHelper.appendTextRow(WebInspector.UIString("Priority"), priority) ;
991 } 991 }
992 if (request.mimeType) 992 if (request.mimeType)
993 contentHelper.appendTextRow(WebInspector.UIString("Mime Type"), request. mimeType); 993 contentHelper.appendTextRow(WebInspector.UIString("Mime Type"), request. mimeType);
994 994
995 var title = WebInspector.UIString("Initiator"); 995 var title = WebInspector.UIString("Initiator");
996 var sendRequest = request.children[0]; 996 var sendRequest = request.children[0];
997 var topFrame = WebInspector.TimelineUIUtils.topStackFrame(sendRequest); 997 var topFrame = WebInspector.TimelineUIUtils.topStackFrame(sendRequest);
998 if (topFrame) { 998 if (topFrame) {
999 contentHelper.appendElementRow(title, linkifier.linkifyConsoleCallFrameF orTimeline(target, topFrame)); 999 var link = linkifier.linkifyConsoleCallFrameForTimeline(target, topFrame );
1000 if (link)
1001 contentHelper.appendElementRow(title, link);
1000 } else if (sendRequest.initiator) { 1002 } else if (sendRequest.initiator) {
1001 var initiatorURL = WebInspector.TimelineUIUtils.eventURL(sendRequest.ini tiator); 1003 var initiatorURL = WebInspector.TimelineUIUtils.eventURL(sendRequest.ini tiator);
1002 if (initiatorURL) 1004 if (initiatorURL) {
1003 contentHelper.appendElementRow(title, linkifier.linkifyScriptLocatio n(target, null, initiatorURL, 0)); 1005 var link = linkifier.linkifyScriptLocation(target, null, initiatorUR L, 0);
1006 if (link)
1007 contentHelper.appendElementRow(title, link);
1008 }
1004 } 1009 }
1005 1010
1006 /** 1011 /**
1007 * @param {function(?Element)} fulfill 1012 * @param {function(?Element)} fulfill
1008 */ 1013 */
1009 function action(fulfill) 1014 function action(fulfill)
1010 { 1015 {
1011 WebInspector.DOMPresentationUtils.buildImagePreviewContents(/** @type {! WebInspector.Target} */(target), request.url, false, saveImage); 1016 WebInspector.DOMPresentationUtils.buildImagePreviewContents(/** @type {! WebInspector.Target} */(target), request.url, false, saveImage);
1012 /** 1017 /**
1013 * @param {!Element=} element 1018 * @param {!Element=} element
(...skipping 1030 matching lines...) Expand 10 before | Expand all | Expand 10 after
2044 * @param {string} url 2049 * @param {string} url
2045 * @param {number} startLine 2050 * @param {number} startLine
2046 * @param {number=} startColumn 2051 * @param {number=} startColumn
2047 */ 2052 */
2048 appendLocationRow: function(title, url, startLine, startColumn) 2053 appendLocationRow: function(title, url, startLine, startColumn)
2049 { 2054 {
2050 if (!this._linkifier || !this._target) 2055 if (!this._linkifier || !this._target)
2051 return; 2056 return;
2052 if (startColumn) 2057 if (startColumn)
2053 --startColumn; 2058 --startColumn;
2054 this.appendElementRow(title, this._linkifier.linkifyScriptLocation(this. _target, null, url, startLine - 1, startColumn)); 2059 var link = this._linkifier.linkifyScriptLocation(this._target, null, url , startLine - 1, startColumn);
2060 if (!link)
2061 return;
2062 this.appendElementRow(title, link);
2055 }, 2063 },
2056 2064
2057 /** 2065 /**
2058 * @param {string} title 2066 * @param {string} title
2059 * @param {string} url 2067 * @param {string} url
2060 * @param {number} startLine 2068 * @param {number} startLine
2061 * @param {number=} endLine 2069 * @param {number=} endLine
2062 */ 2070 */
2063 appendLocationRange: function(title, url, startLine, endLine) 2071 appendLocationRange: function(title, url, startLine, endLine)
2064 { 2072 {
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
2138 case warnings.V8Deopt: 2146 case warnings.V8Deopt:
2139 span.appendChild(WebInspector.linkifyURLAsNode("https://github.com/Googl eChrome/devtools-docs/issues/53", 2147 span.appendChild(WebInspector.linkifyURLAsNode("https://github.com/Googl eChrome/devtools-docs/issues/53",
2140 WebInspector.UIString("Not optimized"), undefined, true)); 2148 WebInspector.UIString("Not optimized"), undefined, true));
2141 span.createTextChild(WebInspector.UIString(": %s", eventData["deoptReaso n"])); 2149 span.createTextChild(WebInspector.UIString(": %s", eventData["deoptReaso n"]));
2142 break; 2150 break;
2143 default: 2151 default:
2144 console.assert(false, "Unhandled TimelineModel.WarningType"); 2152 console.assert(false, "Unhandled TimelineModel.WarningType");
2145 } 2153 }
2146 return span; 2154 return span;
2147 } 2155 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698