Commit e13147a3 authored by loislo@chromium.org's avatar loislo@chromium.org

DevTools: disable debugger when a profiler is active.

this is the first patch. It does only disable debugger if an experiment settings is on.
In the following patches will block panel from switching.


BUG=

Review URL: https://codereview.chromium.org/335403003

git-svn-id: svn://svn.chromium.org/blink/trunk@176324 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent 6293e560
......@@ -2,6 +2,7 @@ var initialize_ProfilerTest = function() {
InspectorTest.startProfilerTest = function(callback)
{
WebInspector.experimentsSettings.disableAgentsWhenProfile.enableForTest();
WebInspector.inspectorView.showPanel("profiles");
InspectorTest.addResult("Profiler was enabled.");
......
......@@ -312,6 +312,7 @@ WebInspector.ExperimentsSettings = function(experimentsEnabled)
this.applyCustomStylesheet = this._createExperiment("applyCustomStylesheet", "Allow custom UI themes");
this.canvasInspection = this._createExperiment("canvasInspection ", "Canvas inspection");
this.devicesPanel = this._createExperiment("devicesPanel", "Devices panel", true);
this.disableAgentsWhenProfile = this._createExperiment("disableAgentsWhenProfile", "Disable other agents and UI when profiler is active", true);
this.dockToLeft = this._createExperiment("dockToLeft", "Dock to left", true);
this.editorInDrawer = this._createExperiment("showEditorInDrawer", "Editor in drawer", true);
this.fileSystemInspection = this._createExperiment("fileSystemInspection", "FileSystem inspection");
......
......@@ -55,7 +55,7 @@ WebInspector.DebuggerModel = function(target)
WebInspector.settings.pauseOnCaughtException.addChangeListener(this._pauseOnExceptionStateChanged, this);
WebInspector.settings.enableAsyncStackTraces.addChangeListener(this._asyncStackTracesStateChanged, this);
target.profilingLock.addEventListener(WebInspector.Lock.Events.StateChanged, this._asyncStackTracesStateChanged, this);
target.profilingLock.addEventListener(WebInspector.Lock.Events.StateChanged, this._profilingStateChanged, this);
this.enableDebugger();
......@@ -169,6 +169,17 @@ WebInspector.DebuggerModel.prototype = {
this._agent.setPauseOnExceptions(state);
},
_profilingStateChanged: function()
{
if (WebInspector.experimentsSettings.disableAgentsWhenProfile.isEnabled()) {
if (this.target().profilingLock.isAcquired())
this.disableDebugger();
else
this.enableDebugger();
}
this._asyncStackTracesStateChanged();
},
_asyncStackTracesStateChanged: function()
{
const maxAsyncStackChainDepth = 4;
......
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