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

Unified Diff: Source/devtools/front_end/sdk/PresentationConsoleMessageHelper.js

Issue 396993003: DevTools: get rid of WebInspector.cssModel, use target models instead (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 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 side-by-side diff with in-line comments
Download patch
Index: Source/devtools/front_end/sdk/PresentationConsoleMessageHelper.js
diff --git a/Source/devtools/front_end/sdk/PresentationConsoleMessageHelper.js b/Source/devtools/front_end/sdk/PresentationConsoleMessageHelper.js
index c0297e1b02e28ceee3b132cdf83a144b5814a11c..6f25bf09a70748f816e301593aa2610bb0ffb1e1 100644
--- a/Source/devtools/front_end/sdk/PresentationConsoleMessageHelper.js
+++ b/Source/devtools/front_end/sdk/PresentationConsoleMessageHelper.js
@@ -43,6 +43,9 @@ WebInspector.PresentationConsoleMessageHelper = function(workspace)
this._workspace = workspace;
WebInspector.targetManager.observeTargets(this);
+ WebInspector.multitargetConsoleModel.addEventListener(WebInspector.ConsoleModel.Events.ConsoleCleared, this._consoleCleared, this);
+ WebInspector.multitargetConsoleModel.addEventListener(WebInspector.ConsoleModel.Events.MessageAdded, this._onConsoleMessageAdded, this);
+ WebInspector.multitargetConsoleModel.messages().forEach(this._consoleMessageAdded, this);
}
WebInspector.PresentationConsoleMessageHelper.prototype = {
@@ -51,9 +54,6 @@ WebInspector.PresentationConsoleMessageHelper.prototype = {
*/
targetAdded: function(target)
{
- target.consoleModel.addEventListener(WebInspector.ConsoleModel.Events.MessageAdded, this._consoleMessageAdded, this);
- target.consoleModel.addEventListener(WebInspector.ConsoleModel.Events.ConsoleCleared, this._consoleCleared, this);
-
target.debuggerModel.addEventListener(WebInspector.DebuggerModel.Events.ParsedScriptSource, this._parsedScriptSource, this);
target.debuggerModel.addEventListener(WebInspector.DebuggerModel.Events.FailedToParseScriptSource, this._parsedScriptSource, this);
target.debuggerModel.addEventListener(WebInspector.DebuggerModel.Events.GlobalObjectCleared, this._debuggerReset, this);
@@ -64,9 +64,6 @@ WebInspector.PresentationConsoleMessageHelper.prototype = {
*/
targetRemoved: function(target)
{
- target.consoleModel.removeEventListener(WebInspector.ConsoleModel.Events.MessageAdded, this._consoleMessageAdded, this);
- target.consoleModel.removeEventListener(WebInspector.ConsoleModel.Events.ConsoleCleared, this._consoleCleared, this);
-
target.debuggerModel.removeEventListener(WebInspector.DebuggerModel.Events.ParsedScriptSource, this._parsedScriptSource, this);
target.debuggerModel.removeEventListener(WebInspector.DebuggerModel.Events.FailedToParseScriptSource, this._parsedScriptSource, this);
target.debuggerModel.removeEventListener(WebInspector.DebuggerModel.Events.GlobalObjectCleared, this._debuggerReset, this);
@@ -75,9 +72,17 @@ WebInspector.PresentationConsoleMessageHelper.prototype = {
/**
* @param {!WebInspector.Event} event
*/
- _consoleMessageAdded: function(event)
+ _onConsoleMessageAdded: function(event)
{
var message = /** @type {!WebInspector.ConsoleMessage} */ (event.data);
+ this._consoleMessageAdded(message)
+ },
+
+ /**
+ * @param {!WebInspector.ConsoleMessage} message
+ */
+ _consoleMessageAdded: function(message)
+ {
if (!message.url || !message.isErrorOrWarning())
return;
« no previous file with comments | « Source/devtools/front_end/sdk/LiveEditSupport.js ('k') | Source/devtools/front_end/sdk/SASSSourceMapping.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698