OLD | NEW |
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 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
48 this._scriptsBySourceURL = new StringMap(); | 48 this._scriptsBySourceURL = new StringMap(); |
49 | 49 |
50 this._breakpointsActive = true; | 50 this._breakpointsActive = true; |
51 /** @type {!WebInspector.Object} */ | 51 /** @type {!WebInspector.Object} */ |
52 this._breakpointResolvedEventTarget = new WebInspector.Object(); | 52 this._breakpointResolvedEventTarget = new WebInspector.Object(); |
53 | 53 |
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 | 56 |
57 WebInspector.settings.enableAsyncStackTraces.addChangeListener(this._asyncSt
ackTracesStateChanged, this); | 57 WebInspector.settings.enableAsyncStackTraces.addChangeListener(this._asyncSt
ackTracesStateChanged, this); |
58 target.profilingLock.addEventListener(WebInspector.Lock.Events.StateChanged,
this._asyncStackTracesStateChanged, this); | 58 target.profilingLock.addEventListener(WebInspector.Lock.Events.StateChanged,
this._profilingStateChanged, this); |
59 | 59 |
60 this.enableDebugger(); | 60 this.enableDebugger(); |
61 | 61 |
62 WebInspector.settings.skipStackFramesSwitch.addChangeListener(this._applySki
pStackFrameSettings, this); | 62 WebInspector.settings.skipStackFramesSwitch.addChangeListener(this._applySki
pStackFrameSettings, this); |
63 WebInspector.settings.skipStackFramesPattern.addChangeListener(this._applySk
ipStackFrameSettings, this); | 63 WebInspector.settings.skipStackFramesPattern.addChangeListener(this._applySk
ipStackFrameSettings, this); |
64 this._applySkipStackFrameSettings(); | 64 this._applySkipStackFrameSettings(); |
65 } | 65 } |
66 | 66 |
67 /** | 67 /** |
68 * Keep these in sync with WebCore::ScriptDebugServer | 68 * Keep these in sync with WebCore::ScriptDebugServer |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
162 if (!WebInspector.settings.pauseOnExceptionEnabled.get()) { | 162 if (!WebInspector.settings.pauseOnExceptionEnabled.get()) { |
163 state = WebInspector.DebuggerModel.PauseOnExceptionsState.DontPauseO
nExceptions; | 163 state = WebInspector.DebuggerModel.PauseOnExceptionsState.DontPauseO
nExceptions; |
164 } else if (WebInspector.settings.pauseOnCaughtException.get()) { | 164 } else if (WebInspector.settings.pauseOnCaughtException.get()) { |
165 state = WebInspector.DebuggerModel.PauseOnExceptionsState.PauseOnAll
Exceptions; | 165 state = WebInspector.DebuggerModel.PauseOnExceptionsState.PauseOnAll
Exceptions; |
166 } else { | 166 } else { |
167 state = WebInspector.DebuggerModel.PauseOnExceptionsState.PauseOnUnc
aughtExceptions; | 167 state = WebInspector.DebuggerModel.PauseOnExceptionsState.PauseOnUnc
aughtExceptions; |
168 } | 168 } |
169 this._agent.setPauseOnExceptions(state); | 169 this._agent.setPauseOnExceptions(state); |
170 }, | 170 }, |
171 | 171 |
| 172 _profilingStateChanged: function() |
| 173 { |
| 174 if (WebInspector.experimentsSettings.disableAgentsWhenProfile.isEnabled(
)) { |
| 175 if (this.target().profilingLock.isAcquired()) |
| 176 this.disableDebugger(); |
| 177 else |
| 178 this.enableDebugger(); |
| 179 } |
| 180 this._asyncStackTracesStateChanged(); |
| 181 }, |
| 182 |
172 _asyncStackTracesStateChanged: function() | 183 _asyncStackTracesStateChanged: function() |
173 { | 184 { |
174 const maxAsyncStackChainDepth = 4; | 185 const maxAsyncStackChainDepth = 4; |
175 var enabled = WebInspector.settings.enableAsyncStackTraces.get() && !thi
s.target().profilingLock.isAcquired(); | 186 var enabled = WebInspector.settings.enableAsyncStackTraces.get() && !thi
s.target().profilingLock.isAcquired(); |
176 this._agent.setAsyncCallStackDepth(enabled ? maxAsyncStackChainDepth : 0
); | 187 this._agent.setAsyncCallStackDepth(enabled ? maxAsyncStackChainDepth : 0
); |
177 }, | 188 }, |
178 | 189 |
179 _debuggerWasDisabled: function() | 190 _debuggerWasDisabled: function() |
180 { | 191 { |
181 this._debuggerEnabled = false; | 192 this._debuggerEnabled = false; |
(...skipping 969 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1151 this.asyncStackTrace.dispose(); | 1162 this.asyncStackTrace.dispose(); |
1152 }, | 1163 }, |
1153 | 1164 |
1154 __proto__: WebInspector.TargetAware.prototype | 1165 __proto__: WebInspector.TargetAware.prototype |
1155 } | 1166 } |
1156 | 1167 |
1157 /** | 1168 /** |
1158 * @type {!WebInspector.DebuggerModel} | 1169 * @type {!WebInspector.DebuggerModel} |
1159 */ | 1170 */ |
1160 WebInspector.debuggerModel; | 1171 WebInspector.debuggerModel; |
OLD | NEW |