Chromium Code Reviews| Index: Source/devtools/front_end/sdk/DOMModel.js |
| diff --git a/Source/devtools/front_end/sdk/DOMModel.js b/Source/devtools/front_end/sdk/DOMModel.js |
| index c9e9e94864b2b433b28dea731f1d9e307fdad8de..96b2e00787b39e8e1acb3b36d058c7d12cac2a05 100644 |
| --- a/Source/devtools/front_end/sdk/DOMModel.js |
| +++ b/Source/devtools/front_end/sdk/DOMModel.js |
| @@ -903,6 +903,10 @@ WebInspector.DOMModel = function(target) { |
| this._defaultHighlighter = new WebInspector.DefaultDOMNodeHighlighter(this._agent); |
| this._highlighter = this._defaultHighlighter; |
| + |
| + if (WebInspector.experimentsSettings.disableAgentsWhenProfile.isEnabled()) |
| + target.profilingLock.addEventListener(WebInspector.Lock.Events.StateChanged, this._profilingStateChanged, this); |
| + |
| this._agent.enable(); |
| } |
| @@ -919,6 +923,14 @@ WebInspector.DOMModel.Events = { |
| } |
| WebInspector.DOMModel.prototype = { |
| + _profilingStateChanged: function() |
| + { |
| + if (this.target().profilingLock.isAcquired()) |
| + this._agent.disable(); |
| + else |
| + this._agent.enable(); |
|
pfeldman
2014/06/26 13:57:17
Lets make ::enable call ::setDocument unless it co
|
| + }, |
| + |
| /** |
| * @param {function(!WebInspector.DOMDocument)=} callback |
| */ |