Commit bdf22b26 authored by shimazu's avatar shimazu Committed by Commit bot

Revert "[DevTools] Make log agent optional."

This reverts commit d0125b8f.

Reason:
Warnings from ServiceWorkerGlobalScope doesn't show up in devtools' console

BUG=594160
TBR=eostroukhov, pfeldman

Review-Url: https://codereview.chromium.org/2344813002
Cr-Commit-Position: refs/heads/master@{#418793}
parent 447f5359
...@@ -32,9 +32,8 @@ ...@@ -32,9 +32,8 @@
* @constructor * @constructor
* @extends {WebInspector.SDKModel} * @extends {WebInspector.SDKModel}
* @param {!WebInspector.Target} target * @param {!WebInspector.Target} target
* @param {?Protocol.LogAgent} logAgent
*/ */
WebInspector.ConsoleModel = function(target, logAgent) WebInspector.ConsoleModel = function(target)
{ {
WebInspector.SDKModel.call(this, WebInspector.ConsoleModel, target); WebInspector.SDKModel.call(this, WebInspector.ConsoleModel, target);
...@@ -45,11 +44,9 @@ WebInspector.ConsoleModel = function(target, logAgent) ...@@ -45,11 +44,9 @@ WebInspector.ConsoleModel = function(target, logAgent)
this._warnings = 0; this._warnings = 0;
this._errors = 0; this._errors = 0;
this._revokedErrors = 0; this._revokedErrors = 0;
this._logAgent = logAgent; this._logAgent = target.logAgent();
if (this._logAgent) { target.registerLogDispatcher(new WebInspector.LogDispatcher(this));
target.registerLogDispatcher(new WebInspector.LogDispatcher(this)); this._logAgent.enable();
this._logAgent.enable();
}
} }
/** @enum {symbol} */ /** @enum {symbol} */
...@@ -137,7 +134,7 @@ WebInspector.ConsoleModel.prototype = { ...@@ -137,7 +134,7 @@ WebInspector.ConsoleModel.prototype = {
requestClearMessages: function() requestClearMessages: function()
{ {
this._logAgent && this._logAgent.clear(); this._logAgent.clear();
this.clear(); this.clear();
}, },
......
...@@ -190,10 +190,8 @@ WebInspector.TargetManager.prototype = { ...@@ -190,10 +190,8 @@ WebInspector.TargetManager.prototype = {
{ {
var target = new WebInspector.Target(this, name, capabilitiesMask, connection, parentTarget); var target = new WebInspector.Target(this, name, capabilitiesMask, connection, parentTarget);
var logAgent = target.hasBrowserCapability() ? target.logAgent() : null;
/** @type {!WebInspector.ConsoleModel} */ /** @type {!WebInspector.ConsoleModel} */
target.consoleModel = new WebInspector.ConsoleModel(target, logAgent); target.consoleModel = new WebInspector.ConsoleModel(target);
/** @type {!WebInspector.RuntimeModel} */ /** @type {!WebInspector.RuntimeModel} */
target.runtimeModel = new WebInspector.RuntimeModel(target); target.runtimeModel = new WebInspector.RuntimeModel(target);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment