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

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/bindings/PresentationConsoleMessageHelper.js

Issue 2163803002: [DevTools] Make WebInspector.ConsoleMessage 0-based (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: addressed comments 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 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 /** 80 /**
81 * @param {!WebInspector.ConsoleMessage} message 81 * @param {!WebInspector.ConsoleMessage} message
82 * @return {?WebInspector.DebuggerModel.Location} 82 * @return {?WebInspector.DebuggerModel.Location}
83 */ 83 */
84 _rawLocation: function(message) 84 _rawLocation: function(message)
85 { 85 {
86 var debuggerModel = WebInspector.DebuggerModel.fromTarget(message.target ()); 86 var debuggerModel = WebInspector.DebuggerModel.fromTarget(message.target ());
87 if (!debuggerModel) 87 if (!debuggerModel)
88 return null; 88 return null;
89 var callFrame = message.stackTrace && message.stackTrace.callFrames ? me ssage.stackTrace.callFrames[0] : null; 89 var callFrame = message.stackTrace && message.stackTrace.callFrames ? me ssage.stackTrace.callFrames[0] : null;
90 // FIXME(62725): stack trace line/column numbers are one-based. 90 var lineNumber = callFrame ? callFrame.lineNumber : message.line;
91 var lineNumber = callFrame ? callFrame.lineNumber : message.line - 1; 91 var columnNumber = callFrame ? callFrame.columnNumber : message.column;
92 var columnNumber = message.column ? message.column - 1 : 0;
93 if (callFrame) 92 if (callFrame)
94 columnNumber = callFrame.columnNumber; 93 columnNumber = callFrame.columnNumber;
95 if (message.scriptId) 94 if (message.scriptId)
96 return debuggerModel.createRawLocationByScriptId(message.scriptId, l ineNumber, columnNumber); 95 return debuggerModel.createRawLocationByScriptId(message.scriptId, l ineNumber, columnNumber);
97 return debuggerModel.createRawLocationByURL(message.url || "", lineNumbe r, columnNumber); 96 return debuggerModel.createRawLocationByURL(message.url || "", lineNumbe r, columnNumber);
98 }, 97 },
99 98
100 /** 99 /**
101 * @param {!WebInspector.ConsoleMessage} message 100 * @param {!WebInspector.ConsoleMessage} message
102 * @param {!WebInspector.DebuggerModel.Location} rawLocation 101 * @param {!WebInspector.DebuggerModel.Location} rawLocation
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
191 190
192 dispose: function() 191 dispose: function()
193 { 192 {
194 if (this._uiMessage) 193 if (this._uiMessage)
195 this._uiMessage.remove(); 194 this._uiMessage.remove();
196 } 195 }
197 } 196 }
198 197
199 /** @type {!WebInspector.PresentationConsoleMessageHelper} */ 198 /** @type {!WebInspector.PresentationConsoleMessageHelper} */
200 WebInspector.presentationConsoleMessageHelper; 199 WebInspector.presentationConsoleMessageHelper;
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698