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

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

Issue 1649553002: [DevTools] Support source map with blackboxing in call frame sidebar, console (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 WebInspector.DebuggerPresentationUtils = {} 5 WebInspector.DebuggerPresentationUtils = {}
6 6
7 /** 7 /**
8 * @param {?WebInspector.DebuggerModel} debuggerModel 8 * @param {?WebInspector.DebuggerModel} debuggerModel
9 * @param {!Array.<!ConsoleAgent.CallFrame>=} stackTrace 9 * @param {!Array.<!ConsoleAgent.CallFrame>=} stackTrace
10 * @param {!ConsoleAgent.AsyncStackTrace=} asyncStackTrace 10 * @param {!ConsoleAgent.AsyncStackTrace=} asyncStackTrace
11 * @param {boolean=} showBlackboxed 11 * @param {boolean=} showBlackboxed
12 * @return {?ConsoleAgent.CallFrame} 12 * @return {?ConsoleAgent.CallFrame}
13 */ 13 */
14 WebInspector.DebuggerPresentationUtils.callFrameAnchorFromStackTrace = function( debuggerModel, stackTrace, asyncStackTrace, showBlackboxed) 14 WebInspector.DebuggerPresentationUtils.callFrameAnchorFromStackTrace = function( debuggerModel, stackTrace, asyncStackTrace, showBlackboxed)
15 { 15 {
16 /** 16 /**
17 * @param {?Array.<!ConsoleAgent.CallFrame>=} stackTrace 17 * @param {?Array.<!ConsoleAgent.CallFrame>=} stackTrace
18 * @return {?ConsoleAgent.CallFrame} 18 * @return {?ConsoleAgent.CallFrame}
19 */ 19 */
20 function innerCallFrameAnchorFromStackTrace(stackTrace) 20 function innerCallFrameAnchorFromStackTrace(stackTrace)
21 { 21 {
22 if (!stackTrace || !stackTrace.length) 22 if (!stackTrace || !stackTrace.length)
23 return null; 23 return null;
24 if (showBlackboxed) 24 if (showBlackboxed)
25 return stackTrace[0]; 25 return stackTrace[0];
26 for (var i = 0; i < stackTrace.length; ++i) { 26 for (var i = 0; i < stackTrace.length; ++i) {
27 var script = debuggerModel && debuggerModel.scriptForId(stackTrace[i ].scriptId); 27 var script = debuggerModel && debuggerModel.scriptForId(stackTrace[i ].scriptId);
28 var blackboxed = script ? 28 var location = script && debuggerModel.createRawLocation(script, sta ckTrace[i].lineNumber, stackTrace[i].columnNumber);
29 WebInspector.BlackboxSupport.isBlackboxed(script.sourceURL, scri pt.isContentScript()) : 29 var blackboxed = location ?
30 WebInspector.BlackboxSupport.isBlackboxedScriptLocation(location ) :
30 WebInspector.BlackboxSupport.isBlackboxedURL(stackTrace[i].url); 31 WebInspector.BlackboxSupport.isBlackboxedURL(stackTrace[i].url);
31 if (!blackboxed) 32 if (!blackboxed)
32 return stackTrace[i]; 33 return stackTrace[i];
33 } 34 }
34 return null; 35 return null;
35 } 36 }
36 37
37 var callFrame = innerCallFrameAnchorFromStackTrace(stackTrace); 38 var callFrame = innerCallFrameAnchorFromStackTrace(stackTrace);
38 if (callFrame) 39 if (callFrame)
39 return callFrame; 40 return callFrame;
40 41
41 while (asyncStackTrace) { 42 while (asyncStackTrace) {
42 callFrame = innerCallFrameAnchorFromStackTrace(asyncStackTrace.callFrame s); 43 callFrame = innerCallFrameAnchorFromStackTrace(asyncStackTrace.callFrame s);
43 if (callFrame) 44 if (callFrame)
44 return callFrame; 45 return callFrame;
45 asyncStackTrace = asyncStackTrace.asyncStackTrace; 46 asyncStackTrace = asyncStackTrace.asyncStackTrace;
46 } 47 }
47 48
48 return stackTrace ? stackTrace[0] : null; 49 return stackTrace ? stackTrace[0] : null;
49 } 50 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698