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

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

Issue 354023002: DevTools: disable DOMAgent when profiler is active (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: comments addressed Created 6 years, 6 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/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();
+ },
+
/**
* @param {function(!WebInspector.DOMDocument)=} callback
*/
« Source/core/inspector/InspectorDOMAgent.cpp ('K') | « Source/core/inspector/InspectorDOMAgent.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698