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

Side by Side Diff: Source/devtools/front_end/sdk/Linkifier.js

Issue 448743002: DevTools: Linkify console stacks with blackboxing consideration. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: addressed 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
« no previous file with comments | « Source/devtools/front_end/networkLogView.css ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2012 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
152 */ 152 */
153 linkifyScriptLocation: function(target, scriptId, sourceURL, lineNumber, col umnNumber, classes) 153 linkifyScriptLocation: function(target, scriptId, sourceURL, lineNumber, col umnNumber, classes)
154 { 154 {
155 var rawLocation = target && !target.isDetached() ? target.debuggerModel. createRawLocationByScriptId(scriptId, sourceURL, lineNumber, columnNumber || 0) : null; 155 var rawLocation = target && !target.isDetached() ? target.debuggerModel. createRawLocationByScriptId(scriptId, sourceURL, lineNumber, columnNumber || 0) : null;
156 var fallbackAnchor = WebInspector.linkifyResourceAsNode(sourceURL, lineN umber, classes); 156 var fallbackAnchor = WebInspector.linkifyResourceAsNode(sourceURL, lineN umber, classes);
157 if (!rawLocation) 157 if (!rawLocation)
158 return fallbackAnchor; 158 return fallbackAnchor;
159 159
160 var anchor = this._createAnchor(classes); 160 var anchor = this._createAnchor(classes);
161 var liveLocation = WebInspector.debuggerWorkspaceBinding.createLiveLocat ion(rawLocation, this._updateAnchor.bind(this, anchor)); 161 var liveLocation = WebInspector.debuggerWorkspaceBinding.createLiveLocat ion(rawLocation, this._updateAnchor.bind(this, anchor));
162 this._liveLocationsByTarget.get(rawLocation.target()).push({anchor: anch or, location: liveLocation}); 162 this._liveLocationsByTarget.get(rawLocation.target()).push({ anchor: anc hor, location: liveLocation });
163 anchor.__fallbackAnchor = fallbackAnchor; 163 anchor.__fallbackAnchor = fallbackAnchor;
164 return anchor; 164 return anchor;
165 }, 165 },
166 166
167 /** 167 /**
168 * @param {!WebInspector.DebuggerModel.Location} rawLocation 168 * @param {!WebInspector.DebuggerModel.Location} rawLocation
169 * @param {string} fallbackUrl 169 * @param {string} fallbackUrl
170 * @param {string=} classes 170 * @param {string=} classes
171 * @return {!Element} 171 * @return {!Element}
172 */ 172 */
173 linkifyRawLocation: function(rawLocation, fallbackUrl, classes) 173 linkifyRawLocation: function(rawLocation, fallbackUrl, classes)
174 { 174 {
175 return this.linkifyScriptLocation(rawLocation.target(), rawLocation.scri ptId, fallbackUrl, rawLocation.lineNumber, rawLocation.columnNumber, classes); 175 return this.linkifyScriptLocation(rawLocation.target(), rawLocation.scri ptId, fallbackUrl, rawLocation.lineNumber, rawLocation.columnNumber, classes);
176 }, 176 },
177 177
178 /** 178 /**
179 * @param {?WebInspector.Target} target 179 * @param {?WebInspector.Target} target
180 * @param {!ConsoleAgent.CallFrame} callFrame 180 * @param {!ConsoleAgent.CallFrame} callFrame
181 * @param {string=} classes 181 * @param {string=} classes
182 * @return {!Element} 182 * @return {!Element}
183 */ 183 */
184 linkifyConsoleCallFrame: function(target, callFrame, classes) 184 linkifyConsoleCallFrame: function(target, callFrame, classes)
185 { 185 {
186 // FIXME(62725): console stack trace line/column numbers are one-based. 186 // FIXME(62725): console stack trace line/column numbers are one-based.
187 var lineNumber = callFrame.lineNumber ? callFrame.lineNumber - 1 : 0; 187 var lineNumber = callFrame.lineNumber ? callFrame.lineNumber - 1 : 0;
188 var columnNumber = callFrame.columnNumber ? callFrame.columnNumber - 1 : 0; 188 var columnNumber = callFrame.columnNumber ? callFrame.columnNumber - 1 : 0;
189 return this.linkifyScriptLocation(target, callFrame.scriptId, callFrame. url, lineNumber, columnNumber, classes); 189 var anchor = this.linkifyScriptLocation(target, callFrame.scriptId, call Frame.url, lineNumber, columnNumber, classes);
190 if (WebInspector.experimentsSettings.frameworksDebuggingSupport.isEnable d() && WebInspector.BlackboxSupport.isBlackboxedURL(callFrame.url))
191 anchor.classList.add("webkit-html-blackbox-link");
192 return anchor;
190 }, 193 },
191 194
192 /** 195 /**
193 * @param {!WebInspector.CSSLocation} rawLocation 196 * @param {!WebInspector.CSSLocation} rawLocation
194 * @param {string=} classes 197 * @param {string=} classes
195 * @return {?Element} 198 * @return {?Element}
196 */ 199 */
197 linkifyCSSLocation: function(rawLocation, classes) 200 linkifyCSSLocation: function(rawLocation, classes)
198 { 201 {
199 var anchor = this._createAnchor(classes); 202 var anchor = this._createAnchor(classes);
200 var liveLocation = WebInspector.cssWorkspaceBinding.createLiveLocation(r awLocation, this._updateAnchor.bind(this, anchor)); 203 var liveLocation = WebInspector.cssWorkspaceBinding.createLiveLocation(r awLocation, this._updateAnchor.bind(this, anchor));
201 if (!liveLocation) 204 if (!liveLocation)
202 return null; 205 return null;
203 this._liveLocationsByTarget.get(rawLocation.target()).push({anchor: anch or, location: liveLocation}); 206 this._liveLocationsByTarget.get(rawLocation.target()).push({ anchor: anc hor, location: liveLocation });
204 return anchor; 207 return anchor;
205 }, 208 },
206 209
207 /** 210 /**
208 * @param {!WebInspector.CSSMedia} media 211 * @param {!WebInspector.CSSMedia} media
209 * @return {?Element} 212 * @return {?Element}
210 */ 213 */
211 linkifyMedia: function(media) 214 linkifyMedia: function(media)
212 { 215 {
213 var location = media.rawLocation(); 216 var location = media.rawLocation();
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after
352 */ 355 */
353 WebInspector.Linkifier.liveLocationText = function(target, scriptId, lineNumber, columnNumber) 356 WebInspector.Linkifier.liveLocationText = function(target, scriptId, lineNumber, columnNumber)
354 { 357 {
355 var script = target.debuggerModel.scriptForId(scriptId); 358 var script = target.debuggerModel.scriptForId(scriptId);
356 if (!script) 359 if (!script)
357 return ""; 360 return "";
358 var location = /** @type {!WebInspector.DebuggerModel.Location} */ (target.d ebuggerModel.createRawLocation(script, lineNumber, columnNumber || 0)); 361 var location = /** @type {!WebInspector.DebuggerModel.Location} */ (target.d ebuggerModel.createRawLocation(script, lineNumber, columnNumber || 0));
359 var uiLocation = /** @type {!WebInspector.UILocation} */ (WebInspector.debug gerWorkspaceBinding.rawLocationToUILocation(location)); 362 var uiLocation = /** @type {!WebInspector.UILocation} */ (WebInspector.debug gerWorkspaceBinding.rawLocationToUILocation(location));
360 return uiLocation.linkText(); 363 return uiLocation.linkText();
361 } 364 }
OLDNEW
« no previous file with comments | « Source/devtools/front_end/networkLogView.css ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698