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

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

Issue 2145483002: [DevTools] make Runtime.CallFrame 0-based (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: a 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) 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 186 matching lines...) Expand 10 before | Expand all | Expand 10 after
197 }, 197 },
198 198
199 /** 199 /**
200 * @param {?WebInspector.Target} target 200 * @param {?WebInspector.Target} target
201 * @param {!RuntimeAgent.CallFrame} callFrame 201 * @param {!RuntimeAgent.CallFrame} callFrame
202 * @param {string=} classes 202 * @param {string=} classes
203 * @return {!Element} 203 * @return {!Element}
204 */ 204 */
205 linkifyConsoleCallFrame: function(target, callFrame, classes) 205 linkifyConsoleCallFrame: function(target, callFrame, classes)
206 { 206 {
207 return this.linkifyScriptLocation(target, callFrame.scriptId, callFrame. url, WebInspector.DebuggerModel.fromOneBased(callFrame.lineNumber), WebInspector .DebuggerModel.fromOneBased(callFrame.columnNumber), classes); 207 return this.linkifyScriptLocation(target, callFrame.scriptId, callFrame. url, callFrame.lineNumber, callFrame.columnNumber, classes);
208 }, 208 },
209 209
210 /** 210 /**
211 * @param {?WebInspector.Target} target
212 * @param {!RuntimeAgent.CallFrame} callFrame
213 * @param {string=} classes
214 * @return {!Element}
215 */
216 linkifyConsoleCallFrameForTimeline: function(target, callFrame, classes)
217 {
218 // TODO(kozyatinskiy): remove this when Profilers will migrate to 0-base d lineNumber and columnNumber.
219 return this.linkifyScriptLocation(target, callFrame.scriptId, callFrame. url, callFrame.lineNumber - 1, callFrame.columnNumber - 1, classes);
220 },
221
222 /**
211 * @param {!WebInspector.Target} target 223 * @param {!WebInspector.Target} target
212 * @param {!RuntimeAgent.StackTrace} stackTrace 224 * @param {!RuntimeAgent.StackTrace} stackTrace
213 * @param {string=} classes 225 * @param {string=} classes
214 * @return {!Element} 226 * @return {!Element}
215 */ 227 */
216 linkifyStackTraceTopFrame: function(target, stackTrace, classes) 228 linkifyStackTraceTopFrame: function(target, stackTrace, classes)
217 { 229 {
218 console.assert(stackTrace.callFrames && stackTrace.callFrames.length); 230 console.assert(stackTrace.callFrames && stackTrace.callFrames.length);
219 231
220 var topFrame = stackTrace.callFrames[0]; 232 var topFrame = stackTrace.callFrames[0];
221 var fallbackAnchor = WebInspector.linkifyResourceAsNode(topFrame.url, We bInspector.DebuggerModel.fromOneBased(topFrame.lineNumber), WebInspector.Debugge rModel.fromOneBased(topFrame.columnNumber), classes); 233 var fallbackAnchor = WebInspector.linkifyResourceAsNode(topFrame.url, to pFrame.lineNumber, topFrame.columnNumber, classes);
222 if (target.isDetached()) 234 if (target.isDetached())
223 return fallbackAnchor; 235 return fallbackAnchor;
224 236
225 var debuggerModel = WebInspector.DebuggerModel.fromTarget(target); 237 var debuggerModel = WebInspector.DebuggerModel.fromTarget(target);
226 var rawLocations = debuggerModel.createRawLocationsByStackTrace(stackTra ce); 238 var rawLocations = debuggerModel.createRawLocationsByStackTrace(stackTra ce);
227 if (rawLocations.length === 0) 239 if (rawLocations.length === 0)
228 return fallbackAnchor; 240 return fallbackAnchor;
229 241
230 var anchor = this._createAnchor(classes); 242 var anchor = this._createAnchor(classes);
231 var liveLocation = WebInspector.debuggerWorkspaceBinding.createStackTrac eTopFrameLiveLocation(rawLocations, this._updateAnchor.bind(this, anchor), /** @ type {!WebInspector.LiveLocationPool} */(this._locationPoolByTarget.get(target)) ); 243 var liveLocation = WebInspector.debuggerWorkspaceBinding.createStackTrac eTopFrameLiveLocation(rawLocations, this._updateAnchor.bind(this, anchor), /** @ type {!WebInspector.LiveLocationPool} */(this._locationPoolByTarget.get(target)) );
(...skipping 354 matching lines...) Expand 10 before | Expand all | Expand 10 after
586 /** 598 /**
587 * @param {!WebInspector.NetworkRequest} request 599 * @param {!WebInspector.NetworkRequest} request
588 * @return {!Element} 600 * @return {!Element}
589 */ 601 */
590 WebInspector.linkifyRequestAsNode = function(request) 602 WebInspector.linkifyRequestAsNode = function(request)
591 { 603 {
592 var anchor = WebInspector.linkifyURLAsNode(request.url); 604 var anchor = WebInspector.linkifyURLAsNode(request.url);
593 anchor.requestId = request.requestId; 605 anchor.requestId = request.requestId;
594 return anchor; 606 return anchor;
595 } 607 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698