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

Unified Diff: third_party/WebKit/Source/devtools/front_end/sources/JavaScriptSourceFrame.js

Issue 1403373013: DevTools: move ui messages from SourceFrame to UISourceCodeFrame (step2) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: review comments addressed Created 5 years, 2 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/devtools/front_end/sources/JavaScriptSourceFrame.js
diff --git a/third_party/WebKit/Source/devtools/front_end/sources/JavaScriptSourceFrame.js b/third_party/WebKit/Source/devtools/front_end/sources/JavaScriptSourceFrame.js
index 48b627163115cf2f782b22aa9ee177dd4bb34c41..8503194c3bc3a4994fefe8d0d7aea07e00e9d490 100644
--- a/third_party/WebKit/Source/devtools/front_end/sources/JavaScriptSourceFrame.js
+++ b/third_party/WebKit/Source/devtools/front_end/sources/JavaScriptSourceFrame.js
@@ -54,9 +54,6 @@ WebInspector.JavaScriptSourceFrame = function(scriptsPanel, uiSourceCode)
this._breakpointManager.addEventListener(WebInspector.BreakpointManager.Events.BreakpointAdded, this._breakpointAdded, this);
this._breakpointManager.addEventListener(WebInspector.BreakpointManager.Events.BreakpointRemoved, this._breakpointRemoved, this);
- WebInspector.presentationConsoleMessageHelper.addConsoleMessageEventListener(WebInspector.PresentationConsoleMessageHelper.Events.ConsoleMessageAdded, this._uiSourceCode, this._consoleMessageAdded, this);
- WebInspector.presentationConsoleMessageHelper.addConsoleMessageEventListener(WebInspector.PresentationConsoleMessageHelper.Events.ConsoleMessageRemoved, this._uiSourceCode, this._consoleMessageRemoved, this);
- WebInspector.presentationConsoleMessageHelper.addConsoleMessageEventListener(WebInspector.PresentationConsoleMessageHelper.Events.ConsoleMessagesCleared, this._uiSourceCode, this._consoleMessagesCleared, this);
this._uiSourceCode.addEventListener(WebInspector.UISourceCode.Events.SourceMappingChanged, this._onSourceMappingChanged, this);
this._uiSourceCode.addEventListener(WebInspector.UISourceCode.Events.WorkingCopyChanged, this._workingCopyChanged, this);
this._uiSourceCode.addEventListener(WebInspector.UISourceCode.Events.WorkingCopyCommitted, this._workingCopyCommitted, this);
@@ -384,8 +381,7 @@ WebInspector.JavaScriptSourceFrame.prototype = {
var compileError = liveEditErrorData.compileError;
if (compileError) {
var messageText = WebInspector.UIString("LiveEdit compile failed: %s", compileError.message);
- var message = new WebInspector.UISourceCode.Message(WebInspector.UISourceCode.Message.Level.Error, messageText, compileError.lineNumber - 1, compileError.columnNumber + 1);
- this.addMessageToSource(message);
+ this.uiSourceCode().addMessage(WebInspector.UISourceCode.Message.Level.Error, messageText, compileError.lineNumber - 1, compileError.columnNumber + 1);
} else {
WebInspector.console.addMessage(WebInspector.UIString("Unknown LiveEdit error: %s; %s", JSON.stringify(liveEditErrorData), liveEditError), warningLevel);
}
@@ -938,34 +934,6 @@ WebInspector.JavaScriptSourceFrame.prototype = {
this._removeBreakpointDecoration(uiLocation.lineNumber);
},
- _consoleMessageAdded: function(event)
- {
- var message = /** @type {!WebInspector.PresentationConsoleMessage} */ (event.data);
- if (this.loaded)
- this.addMessageToSource(this._sourceFrameMessage(message));
- },
-
- _consoleMessageRemoved: function(event)
- {
- var message = /** @type {!WebInspector.PresentationConsoleMessage} */ (event.data);
- if (this.loaded)
- this.removeMessageFromSource(this._sourceFrameMessage(message));
- },
-
- /**
- * @param {!WebInspector.PresentationConsoleMessage} message
- * @return {!WebInspector.UISourceCode.Message}
- */
- _sourceFrameMessage: function(message)
- {
- return WebInspector.UISourceCodeFrame.uiMessageFromConsoleMessage(message.originalMessage, message.lineNumber(), message.columnNumber());
- },
-
- _consoleMessagesCleared: function(event)
- {
- this.clearMessages();
- },
-
/**
* @param {!WebInspector.Event} event
*/
@@ -1016,6 +984,9 @@ WebInspector.JavaScriptSourceFrame.prototype = {
}
},
+ /**
+ * @override
+ */
onTextEditorContentLoaded: function()
{
WebInspector.UISourceCodeFrame.prototype.onTextEditorContentLoaded.call(this);
@@ -1026,10 +997,6 @@ WebInspector.JavaScriptSourceFrame.prototype = {
for (var i = 0; i < breakpointLocations.length; ++i)
this._breakpointAdded({data:breakpointLocations[i]});
- var messages = WebInspector.presentationConsoleMessageHelper.consoleMessages(this._uiSourceCode);
- for (var message of messages)
- this.addMessageToSource(this._sourceFrameMessage(message));
-
var scriptFiles = this._scriptFileForTarget.valuesArray();
for (var i = 0; i < scriptFiles.length; ++i)
scriptFiles[i].checkMapping();
@@ -1110,9 +1077,6 @@ WebInspector.JavaScriptSourceFrame.prototype = {
{
this._breakpointManager.removeEventListener(WebInspector.BreakpointManager.Events.BreakpointAdded, this._breakpointAdded, this);
this._breakpointManager.removeEventListener(WebInspector.BreakpointManager.Events.BreakpointRemoved, this._breakpointRemoved, this);
- WebInspector.presentationConsoleMessageHelper.removeConsoleMessageEventListener(WebInspector.PresentationConsoleMessageHelper.Events.ConsoleMessageAdded, this._uiSourceCode, this._consoleMessageAdded, this);
- WebInspector.presentationConsoleMessageHelper.removeConsoleMessageEventListener(WebInspector.PresentationConsoleMessageHelper.Events.ConsoleMessageRemoved, this._uiSourceCode, this._consoleMessageRemoved, this);
- WebInspector.presentationConsoleMessageHelper.removeConsoleMessageEventListener(WebInspector.PresentationConsoleMessageHelper.Events.ConsoleMessagesCleared, this._uiSourceCode, this._consoleMessagesCleared, this);
this._uiSourceCode.removeEventListener(WebInspector.UISourceCode.Events.SourceMappingChanged, this._onSourceMappingChanged, this);
this._uiSourceCode.removeEventListener(WebInspector.UISourceCode.Events.WorkingCopyChanged, this._workingCopyChanged, this);
this._uiSourceCode.removeEventListener(WebInspector.UISourceCode.Events.WorkingCopyCommitted, this._workingCopyCommitted, this);

Powered by Google App Engine
This is Rietveld 408576698