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

Side by Side Diff: Source/devtools/front_end/console/ConsoleViewMessage.js

Issue 404953004: DevTools: Refactor linkifyRawLocation to use fallback url (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase on master 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
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) 2009 Joseph Pecoraro 4 * Copyright (C) 2009 Joseph Pecoraro
5 * 5 *
6 * Redistribution and use in source and binary forms, with or without 6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions 7 * modification, are permitted provided that the following conditions
8 * are met: 8 * are met:
9 * 9 *
10 * 1. Redistributions of source code must retain the above copyright 10 * 1. Redistributions of source code must retain the above copyright
(...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after
259 return null; 259 return null;
260 // FIXME(62725): stack trace line/column numbers are one-based. 260 // FIXME(62725): stack trace line/column numbers are one-based.
261 lineNumber = lineNumber ? lineNumber - 1 : 0; 261 lineNumber = lineNumber ? lineNumber - 1 : 0;
262 columnNumber = columnNumber ? columnNumber - 1 : 0; 262 columnNumber = columnNumber ? columnNumber - 1 : 0;
263 if (this._message.source === WebInspector.ConsoleMessage.MessageSource.C SS) { 263 if (this._message.source === WebInspector.ConsoleMessage.MessageSource.C SS) {
264 var headerIds = target.cssModel.styleSheetIdsForURL(url); 264 var headerIds = target.cssModel.styleSheetIdsForURL(url);
265 var cssLocation = new WebInspector.CSSLocation(target, headerIds[0] || null, url, lineNumber, columnNumber); 265 var cssLocation = new WebInspector.CSSLocation(target, headerIds[0] || null, url, lineNumber, columnNumber);
266 return this._linkifier.linkifyCSSLocation(cssLocation, "console-mess age-url"); 266 return this._linkifier.linkifyCSSLocation(cssLocation, "console-mess age-url");
267 } 267 }
268 268
269 return this._linkifier.linkifyLocation(target, url, lineNumber, columnNu mber, "console-message-url"); 269 return this._linkifier.linkifyScriptLocation(target, null, url, lineNumb er, columnNumber, "console-message-url");
270 }, 270 },
271 271
272 /** 272 /**
273 * @param {!ConsoleAgent.CallFrame} callFrame 273 * @param {!ConsoleAgent.CallFrame} callFrame
274 * @return {?Element} 274 * @return {?Element}
275 */ 275 */
276 _linkifyCallFrame: function(callFrame) 276 _linkifyCallFrame: function(callFrame)
277 { 277 {
278 console.assert(this._linkifier); 278 console.assert(this._linkifier);
279 var target = this._target(); 279 var target = this._target();
280 if (!this._linkifier || !target) 280 if (!this._linkifier)
281 return null; 281 return null;
282 var rawLocation = this._target().debuggerModel.createRawLocationByConsol eCallFrame(callFrame); 282
283 return this._linkifier.linkifyRawLocation(rawLocation, "console-message- url"); 283 // FIXME(62725): stack trace line/column numbers are one-based.
aandrey 2014/07/29 16:50:22 I moved this FIXME into one place, why undo this w
sergeyv 2014/07/30 09:31:13 Done.
284 var lineNumber = callFrame.lineNumber ? callFrame.lineNumber - 1 : 0;
285 var columnNumber = callFrame.columnNumber ? callFrame.columnNumber - 1 : 0;
286 return this._linkifier.linkifyScriptLocation(target, callFrame.scriptId, callFrame.url, lineNumber, columnNumber, "console-message-url");
284 }, 287 },
285 288
286 /** 289 /**
287 * @param {?Array.<!ConsoleAgent.CallFrame>} stackTrace 290 * @param {?Array.<!ConsoleAgent.CallFrame>} stackTrace
288 * @return {?ConsoleAgent.CallFrame} 291 * @return {?ConsoleAgent.CallFrame}
289 */ 292 */
290 _callFrameAnchorFromStackTrace: function(stackTrace) 293 _callFrameAnchorFromStackTrace: function(stackTrace)
291 { 294 {
292 if (!stackTrace || !stackTrace.length) 295 if (!stackTrace || !stackTrace.length)
293 return null; 296 return null;
(...skipping 964 matching lines...) Expand 10 before | Expand all | Expand 10 after
1258 { 1261 {
1259 if (!this._wrapperElement) { 1262 if (!this._wrapperElement) {
1260 WebInspector.ConsoleViewMessage.prototype.toMessageElement.call(this ); 1263 WebInspector.ConsoleViewMessage.prototype.toMessageElement.call(this );
1261 this._wrapperElement.classList.toggle("collapsed", this._collapsed); 1264 this._wrapperElement.classList.toggle("collapsed", this._collapsed);
1262 } 1265 }
1263 return this._wrapperElement; 1266 return this._wrapperElement;
1264 }, 1267 },
1265 1268
1266 __proto__: WebInspector.ConsoleViewMessage.prototype 1269 __proto__: WebInspector.ConsoleViewMessage.prototype
1267 } 1270 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698