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

Unified Diff: third_party/WebKit/Source/devtools/front_end/workspace/UISourceCode.js

Issue 1456943003: Devtools: use TextRange in UISourceCode.Message, allow addMessage to take a TextRange (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: trim whitespace Created 5 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/Source/devtools/front_end/sources/JavaScriptCompiler.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/devtools/front_end/workspace/UISourceCode.js
diff --git a/third_party/WebKit/Source/devtools/front_end/workspace/UISourceCode.js b/third_party/WebKit/Source/devtools/front_end/workspace/UISourceCode.js
index 9e5d61a10433cf3a6e7ff699a1b35822fd00c10e..80e9b5306bc9be5e3d251e57e1e221d9f60ca02e 100644
--- a/third_party/WebKit/Source/devtools/front_end/workspace/UISourceCode.js
+++ b/third_party/WebKit/Source/devtools/front_end/workspace/UISourceCode.js
@@ -596,9 +596,20 @@ WebInspector.UISourceCode.prototype = {
* @param {number=} columnNumber
* @return {!WebInspector.UISourceCode.Message} message
*/
- addMessage: function(level, text, lineNumber, columnNumber)
+ addLineMessage: function(level, text, lineNumber, columnNumber)
{
- var message = new WebInspector.UISourceCode.Message(this, level, text, lineNumber, columnNumber);
+ return this.addMessage(level, text, new WebInspector.TextRange(lineNumber, columnNumber || 0, lineNumber, columnNumber || 0));
+ },
+
+ /**
+ * @param {!WebInspector.UISourceCode.Message.Level} level
+ * @param {string} text
+ * @param {!WebInspector.TextRange} range
+ * @return {!WebInspector.UISourceCode.Message} message
+ */
+ addMessage: function(level, text, range)
+ {
+ var message = new WebInspector.UISourceCode.Message(this, level, text, range);
this._messages.push(message);
this.dispatchEventToListeners(WebInspector.UISourceCode.Events.MessageAdded, message);
return message;
@@ -765,16 +776,14 @@ WebInspector.Revision.prototype = {
* @param {!WebInspector.UISourceCode} uiSourceCode
* @param {!WebInspector.UISourceCode.Message.Level} level
* @param {string} text
- * @param {number} lineNumber
- * @param {number=} columnNumber
+ * @param {!WebInspector.TextRange} range
*/
-WebInspector.UISourceCode.Message = function(uiSourceCode, level, text, lineNumber, columnNumber)
+WebInspector.UISourceCode.Message = function(uiSourceCode, level, text, range)
{
this._uiSourceCode = uiSourceCode;
this._level = level;
this._text = text;
- this._lineNumber = lineNumber;
- this._columnNumber = columnNumber;
+ this._range = range;
}
/**
@@ -811,11 +820,18 @@ WebInspector.UISourceCode.Message.prototype = {
},
/**
+ * @return {!WebInspector.TextRange}
+ */
+ range: function() {
+ return this._range;
+ },
+
+ /**
* @return {number}
*/
lineNumber: function()
{
- return this._lineNumber;
+ return this._range.startLine;
},
/**
@@ -823,7 +839,7 @@ WebInspector.UISourceCode.Message.prototype = {
*/
columnNumber: function()
{
- return this._columnNumber;
+ return this._range.startColumn;
},
/**
@@ -832,7 +848,7 @@ WebInspector.UISourceCode.Message.prototype = {
*/
isEqual: function(another)
{
- return this._uiSourceCode === another._uiSourceCode && this.text() === another.text() && this.level() === another.level() && this.lineNumber() === another.lineNumber() && this.columnNumber() === another.columnNumber();
+ return this._uiSourceCode === another._uiSourceCode && this.text() === another.text() && this.level() === another.level() && this.range().equal(another.range());
},
remove: function()
« no previous file with comments | « third_party/WebKit/Source/devtools/front_end/sources/JavaScriptCompiler.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698