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

Unified Diff: third_party/WebKit/Source/devtools/front_end/sdk/ConsoleModel.js

Issue 2345873002: [Devtools] Add capability for the log domain (Closed)
Patch Set: [Devtools] Add capability for the log domain Created 4 years, 3 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/sdk/ConsoleModel.js
diff --git a/third_party/WebKit/Source/devtools/front_end/sdk/ConsoleModel.js b/third_party/WebKit/Source/devtools/front_end/sdk/ConsoleModel.js
index a77974c551e79737e4dc2ece37723649b288618a..20d6df070b8ac8afa91d05459657a515ec22cf8a 100644
--- a/third_party/WebKit/Source/devtools/front_end/sdk/ConsoleModel.js
+++ b/third_party/WebKit/Source/devtools/front_end/sdk/ConsoleModel.js
@@ -32,8 +32,9 @@
* @constructor
* @extends {WebInspector.SDKModel}
* @param {!WebInspector.Target} target
+ * @param {?Protocol.LogAgent} logAgent
*/
-WebInspector.ConsoleModel = function(target)
+WebInspector.ConsoleModel = function(target, logAgent)
{
WebInspector.SDKModel.call(this, WebInspector.ConsoleModel, target);
@@ -44,9 +45,11 @@ WebInspector.ConsoleModel = function(target)
this._warnings = 0;
this._errors = 0;
this._revokedErrors = 0;
- this._logAgent = target.logAgent();
- target.registerLogDispatcher(new WebInspector.LogDispatcher(this));
- this._logAgent.enable();
+ this._logAgent = logAgent;
+ if (this._logAgent) {
+ target.registerLogDispatcher(new WebInspector.LogDispatcher(this));
+ this._logAgent.enable();
+ }
}
/** @enum {symbol} */
@@ -134,7 +137,7 @@ WebInspector.ConsoleModel.prototype = {
requestClearMessages: function()
{
- this._logAgent.clear();
+ this._logAgent && this._logAgent.clear();
this.clear();
},

Powered by Google App Engine
This is Rietveld 408576698