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

Side by Side Diff: Source/devtools/front_end/sdk/DebuggerModel.js

Issue 614323003: DevTools: enable by default disableAgentsWhenProfile experiment (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: small change Created 6 years, 2 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2010 Google Inc. All rights reserved. 2 * Copyright (C) 2010 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 this._scripts = {}; 46 this._scripts = {};
47 /** @type {!StringMap.<!Array.<!WebInspector.Script>>} */ 47 /** @type {!StringMap.<!Array.<!WebInspector.Script>>} */
48 this._scriptsBySourceURL = new StringMap(); 48 this._scriptsBySourceURL = new StringMap();
49 49
50 /** @type {!WebInspector.Object} */ 50 /** @type {!WebInspector.Object} */
51 this._breakpointResolvedEventTarget = new WebInspector.Object(); 51 this._breakpointResolvedEventTarget = new WebInspector.Object();
52 52
53 this._isPausing = false; 53 this._isPausing = false;
54 WebInspector.settings.pauseOnExceptionEnabled.addChangeListener(this._pauseO nExceptionStateChanged, this); 54 WebInspector.settings.pauseOnExceptionEnabled.addChangeListener(this._pauseO nExceptionStateChanged, this);
55 WebInspector.settings.pauseOnCaughtException.addChangeListener(this._pauseOn ExceptionStateChanged, this); 55 WebInspector.settings.pauseOnCaughtException.addChangeListener(this._pauseOn ExceptionStateChanged, this);
56
57 WebInspector.settings.enableAsyncStackTraces.addChangeListener(this._asyncSt ackTracesStateChanged, this); 56 WebInspector.settings.enableAsyncStackTraces.addChangeListener(this._asyncSt ackTracesStateChanged, this);
58 WebInspector.profilingLock().addEventListener(WebInspector.Lock.Events.State Changed, this._profilingStateChanged, this); 57 WebInspector.settings.skipStackFramesPattern.addChangeListener(this._applySk ipStackFrameSettings, this);
58 WebInspector.settings.skipContentScripts.addChangeListener(this._applySkipSt ackFrameSettings, this);
59 59
60 this.enableDebugger(); 60 this.enableDebugger();
61 61
62 WebInspector.settings.skipStackFramesPattern.addChangeListener(this._applySk ipStackFrameSettings, this);
63 WebInspector.settings.skipContentScripts.addChangeListener(this._applySkipSt ackFrameSettings, this);
64 this._applySkipStackFrameSettings(); 62 this._applySkipStackFrameSettings();
65 } 63 }
66 64
67 /** @typedef {{location: ?WebInspector.DebuggerModel.Location, sourceURL: ?strin g, functionName: string, scopeChain: (Array.<!DebuggerAgent.Scope>|null)}} */ 65 /** @typedef {{location: ?WebInspector.DebuggerModel.Location, sourceURL: ?strin g, functionName: string, scopeChain: (Array.<!DebuggerAgent.Scope>|null)}} */
68 WebInspector.DebuggerModel.FunctionDetails; 66 WebInspector.DebuggerModel.FunctionDetails;
69 67
70 /** 68 /**
71 * Keep these in sync with WebCore::ScriptDebugServer 69 * Keep these in sync with WebCore::ScriptDebugServer
72 * 70 *
73 * @enum {string} 71 * @enum {string}
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
121 }, 119 },
122 120
123 disableDebugger: function() 121 disableDebugger: function()
124 { 122 {
125 if (!this._debuggerEnabled) 123 if (!this._debuggerEnabled)
126 return; 124 return;
127 125
128 this._agent.disable(); 126 this._agent.disable();
129 this._debuggerEnabled = false; 127 this._debuggerEnabled = false;
130 this._isPausing = false; 128 this._isPausing = false;
129 this._asyncStackTracesStateChanged();
131 this.dispatchEventToListeners(WebInspector.DebuggerModel.Events.Debugger WasDisabled); 130 this.dispatchEventToListeners(WebInspector.DebuggerModel.Events.Debugger WasDisabled);
132 }, 131 },
133 132
134 /** 133 /**
135 * @param {boolean} skip 134 * @param {boolean} skip
136 * @param {boolean=} untilReload 135 * @param {boolean=} untilReload
137 */ 136 */
138 skipAllPauses: function(skip, untilReload) 137 skipAllPauses: function(skip, untilReload)
139 { 138 {
140 if (this._skipAllPausesTimeout) { 139 if (this._skipAllPausesTimeout) {
(...skipping 21 matching lines...) Expand all
162 if (!WebInspector.settings.pauseOnExceptionEnabled.get()) { 161 if (!WebInspector.settings.pauseOnExceptionEnabled.get()) {
163 state = WebInspector.DebuggerModel.PauseOnExceptionsState.DontPauseO nExceptions; 162 state = WebInspector.DebuggerModel.PauseOnExceptionsState.DontPauseO nExceptions;
164 } else if (WebInspector.settings.pauseOnCaughtException.get()) { 163 } else if (WebInspector.settings.pauseOnCaughtException.get()) {
165 state = WebInspector.DebuggerModel.PauseOnExceptionsState.PauseOnAll Exceptions; 164 state = WebInspector.DebuggerModel.PauseOnExceptionsState.PauseOnAll Exceptions;
166 } else { 165 } else {
167 state = WebInspector.DebuggerModel.PauseOnExceptionsState.PauseOnUnc aughtExceptions; 166 state = WebInspector.DebuggerModel.PauseOnExceptionsState.PauseOnUnc aughtExceptions;
168 } 167 }
169 this._agent.setPauseOnExceptions(state); 168 this._agent.setPauseOnExceptions(state);
170 }, 169 },
171 170
172 _profilingStateChanged: function() 171 suspendModel: function()
173 { 172 {
174 if (Runtime.experiments.isEnabled("disableAgentsWhenProfile")) { 173 this.disableDebugger();
175 if (WebInspector.profilingLock().isAcquired()) 174 },
176 this.disableDebugger(); 175
177 else 176 resumeModel: function()
178 this.enableDebugger(); 177 {
179 } 178 this.enableDebugger();
180 this._asyncStackTracesStateChanged();
181 }, 179 },
182 180
183 _asyncStackTracesStateChanged: function() 181 _asyncStackTracesStateChanged: function()
184 { 182 {
185 const maxAsyncStackChainDepth = 4; 183 const maxAsyncStackChainDepth = 4;
186 var enabled = WebInspector.settings.enableAsyncStackTraces.get() && !Web Inspector.profilingLock().isAcquired(); 184 var enabled = WebInspector.settings.enableAsyncStackTraces.get() && !Web Inspector.targetManager.areTargetsSuspended();
187 this._agent.setAsyncCallStackDepth(enabled ? maxAsyncStackChainDepth : 0 ); 185 this._agent.setAsyncCallStackDepth(enabled ? maxAsyncStackChainDepth : 0 );
188 }, 186 },
189 187
190 stepInto: function() 188 stepInto: function()
191 { 189 {
192 /** 190 /**
193 * @this {WebInspector.DebuggerModel} 191 * @this {WebInspector.DebuggerModel}
194 */ 192 */
195 function callback() 193 function callback()
196 { 194 {
(...skipping 905 matching lines...) Expand 10 before | Expand all | Expand 10 after
1102 return this.target().runtimeModel.createRemoteObject(/** @type {!Runtime Agent.RemoteObject} */(this.auxData)); 1100 return this.target().runtimeModel.createRemoteObject(/** @type {!Runtime Agent.RemoteObject} */(this.auxData));
1103 }, 1101 },
1104 1102
1105 __proto__: WebInspector.SDKObject.prototype 1103 __proto__: WebInspector.SDKObject.prototype
1106 } 1104 }
1107 1105
1108 /** 1106 /**
1109 * @type {!WebInspector.DebuggerModel} 1107 * @type {!WebInspector.DebuggerModel}
1110 */ 1108 */
1111 WebInspector.debuggerModel; 1109 WebInspector.debuggerModel;
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698