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(); |
}, |