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

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/components/DOMPresentationUtils.js

Issue 1666563005: DevTools: merge ScriptCallStack and ScriptAsyncCallStack, move CallStacks from console to Runtime. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: testts Created 4 years, 10 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) 2011 Google Inc. All rights reserved. 2 * Copyright (C) 2011 Google Inc. All rights reserved.
3 * Copyright (C) 2007, 2008 Apple Inc. All rights reserved. 3 * Copyright (C) 2007, 2008 Apple Inc. All rights reserved.
4 * Copyright (C) 2008 Matt Lilek <webkit@mattlilek.com> 4 * Copyright (C) 2008 Matt Lilek <webkit@mattlilek.com>
5 * Copyright (C) 2009 Joseph Pecoraro 5 * Copyright (C) 2009 Joseph Pecoraro
6 * 6 *
7 * Redistribution and use in source and binary forms, with or without 7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions 8 * modification, are permitted provided that the following conditions
9 * are met: 9 * are met:
10 * 10 *
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after
211 container.createChild("tr").createChild("td").createChild("span", "d escription").textContent = description; 211 container.createChild("tr").createChild("td").createChild("span", "d escription").textContent = description;
212 if (imageURL !== originalImageURL) 212 if (imageURL !== originalImageURL)
213 container.createChild("tr").createChild("td").createChild("span", "d escription").textContent = String.sprintf("currentSrc: %s", imageURL.trimMiddle( 100)); 213 container.createChild("tr").createChild("td").createChild("span", "d escription").textContent = String.sprintf("currentSrc: %s", imageURL.trimMiddle( 100));
214 userCallback(container); 214 userCallback(container);
215 } 215 }
216 } 216 }
217 217
218 /** 218 /**
219 * @param {!WebInspector.Target} target 219 * @param {!WebInspector.Target} target
220 * @param {!WebInspector.Linkifier} linkifier 220 * @param {!WebInspector.Linkifier} linkifier
221 * @param {!Array.<!ConsoleAgent.CallFrame>=} stackTrace 221 * @param {!RuntimeAgent.StackTrace=} stackTrace
222 * @param {!ConsoleAgent.AsyncStackTrace=} asyncStackTrace
223 * @return {!Element} 222 * @return {!Element}
224 */ 223 */
225 WebInspector.DOMPresentationUtils.buildStackTracePreviewContents = function(targ et, linkifier, stackTrace, asyncStackTrace) 224 WebInspector.DOMPresentationUtils.buildStackTracePreviewContents = function(targ et, linkifier, stackTrace)
226 { 225 {
227 var element = createElement("span"); 226 var element = createElement("span");
228 element.style.display = "inline-block"; 227 element.style.display = "inline-block";
229 var shadowRoot = WebInspector.createShadowRootWithCoreStyles(element, "compo nents/domUtils.css"); 228 var shadowRoot = WebInspector.createShadowRootWithCoreStyles(element, "compo nents/domUtils.css");
230 var contentElement = shadowRoot.createChild("table", "stack-preview-containe r"); 229 var contentElement = shadowRoot.createChild("table", "stack-preview-containe r");
231 230
232 /** 231 /**
233 * @param {!Array.<!ConsoleAgent.CallFrame>} stackTrace 232 * @param {!RuntimeAgent.StackTrace} stackTrace
234 */ 233 */
235 function appendStackTrace(stackTrace) 234 function appendStackTrace(stackTrace)
236 { 235 {
237 for (var stackFrame of stackTrace) { 236 for (var stackFrame of stackTrace.callFrames) {
238 var row = createElement("tr"); 237 var row = createElement("tr");
239 row.createChild("td", "function-name").textContent = WebInspector.be autifyFunctionName(stackFrame.functionName); 238 row.createChild("td", "function-name").textContent = WebInspector.be autifyFunctionName(stackFrame.functionName);
240 row.createChild("td").textContent = " @ "; 239 row.createChild("td").textContent = " @ ";
241 row.createChild("td").appendChild(linkifier.linkifyConsoleCallFrame( target, stackFrame)); 240 row.createChild("td").appendChild(linkifier.linkifyConsoleCallFrame( target, stackFrame));
242 contentElement.appendChild(row); 241 contentElement.appendChild(row);
243 } 242 }
244 } 243 }
245 244
246 if (stackTrace) 245 if (!stackTrace)
247 appendStackTrace(stackTrace); 246 return element;
248 247
248 appendStackTrace(stackTrace);
249
250 var asyncStackTrace = stackTrace.parent;
249 while (asyncStackTrace) { 251 while (asyncStackTrace) {
250 var callFrames = asyncStackTrace.callFrames; 252 if (!asyncStackTrace.callFrames.length) {
251 if (!callFrames || !callFrames.length) 253 asyncStackTrace = asyncStackTrace.parent;
252 break; 254 continue;
255 }
253 var row = contentElement.createChild("tr"); 256 var row = contentElement.createChild("tr");
254 row.createChild("td", "stack-preview-async-description").textContent = W ebInspector.asyncStackTraceLabel(asyncStackTrace.description); 257 row.createChild("td", "stack-preview-async-description").textContent = W ebInspector.asyncStackTraceLabel(asyncStackTrace.description);
255 row.createChild("td"); 258 row.createChild("td");
256 row.createChild("td"); 259 row.createChild("td");
257 appendStackTrace(callFrames); 260 appendStackTrace(asyncStackTrace);
258 asyncStackTrace = asyncStackTrace.asyncStackTrace; 261 asyncStackTrace = asyncStackTrace.parent;
259 } 262 }
260 263
261 return element; 264 return element;
262 } 265 }
263 266
264 /** 267 /**
265 * @param {!WebInspector.DOMNode} node 268 * @param {!WebInspector.DOMNode} node
266 * @param {boolean=} justSelector 269 * @param {boolean=} justSelector
267 * @return {string} 270 * @return {string}
268 */ 271 */
(...skipping 381 matching lines...) Expand 10 before | Expand all | Expand 10 after
650 /** 653 /**
651 * @override 654 * @override
652 * @param {!WebInspector.DOMNode} node 655 * @param {!WebInspector.DOMNode} node
653 * @return {?{title: string, color: string}} 656 * @return {?{title: string, color: string}}
654 */ 657 */
655 decorate: function(node) 658 decorate: function(node)
656 { 659 {
657 return { title: this._title, color: this._color }; 660 return { title: this._title, color: this._color };
658 } 661 }
659 } 662 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698