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

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

Issue 400633003: DevTools: introduce multitarget model listeners (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 6f25bf09a70748f816e301593aa2610bb0ffb1e1..0884ee1667255935a5122305be8838f1231d3a27 100644
--- a/Source/devtools/front_end/sdk/PresentationConsoleMessageHelper.js
+++ b/Source/devtools/front_end/sdk/PresentationConsoleMessageHelper.js
@@ -30,7 +30,6 @@
/**
* @constructor
- * @implements {WebInspector.TargetManager.Observer}
* @param {!WebInspector.Workspace} workspace
*/
WebInspector.PresentationConsoleMessageHelper = function(workspace)
@@ -42,34 +41,16 @@ WebInspector.PresentationConsoleMessageHelper = function(workspace)
this._presentationConsoleMessages = [];
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.targetManager.addModelListener(WebInspector.DebuggerModel, WebInspector.DebuggerModel.Events.ParsedScriptSource, this._parsedScriptSource, this);
+ WebInspector.targetManager.addModelListener(WebInspector.DebuggerModel, WebInspector.DebuggerModel.Events.FailedToParseScriptSource, this._parsedScriptSource, this);
+ WebInspector.targetManager.addModelListener(WebInspector.DebuggerModel, WebInspector.DebuggerModel.Events.GlobalObjectCleared, this._debuggerReset, this);
}
WebInspector.PresentationConsoleMessageHelper.prototype = {
/**
- * @param {!WebInspector.Target} target
- */
- targetAdded: function(target)
- {
- 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);
- },
-
- /**
- * @param {!WebInspector.Target} target
- */
- targetRemoved: function(target)
- {
- 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);
- },
-
- /**
* @param {!WebInspector.Event} event
*/
_onConsoleMessageAdded: function(event)
« no previous file with comments | « Source/devtools/front_end/sdk/NetworkUISourceCodeProvider.js ('k') | Source/devtools/front_end/sdk/ResourceTreeModel.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698