Chromium Code Reviews| 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 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 55 this._scriptsBySourceURL = new Map(); | 55 this._scriptsBySourceURL = new Map(); |
| 56 /** @type {!Array.<!SDK.Script>} */ | 56 /** @type {!Array.<!SDK.Script>} */ |
| 57 this._discardableScripts = []; | 57 this._discardableScripts = []; |
| 58 | 58 |
| 59 /** @type {!Common.Object} */ | 59 /** @type {!Common.Object} */ |
| 60 this._breakpointResolvedEventTarget = new Common.Object(); | 60 this._breakpointResolvedEventTarget = new Common.Object(); |
| 61 | 61 |
| 62 this._isPausing = false; | 62 this._isPausing = false; |
| 63 Common.moduleSetting('pauseOnExceptionEnabled').addChangeListener(this._paus eOnExceptionStateChanged, this); | 63 Common.moduleSetting('pauseOnExceptionEnabled').addChangeListener(this._paus eOnExceptionStateChanged, this); |
| 64 Common.moduleSetting('pauseOnCaughtException').addChangeListener(this._pause OnExceptionStateChanged, this); | 64 Common.moduleSetting('pauseOnCaughtException').addChangeListener(this._pause OnExceptionStateChanged, this); |
| 65 Common.moduleSetting('enableAsyncStackTraces').addChangeListener(this.asyncS tackTracesStateChanged, this); | 65 Common.moduleSetting('disableAsyncStackTraces').addChangeListener(this.async StackTracesStateChanged, this); |
| 66 | 66 |
| 67 /** @type {!Map<string, string>} */ | 67 /** @type {!Map<string, string>} */ |
| 68 this._fileURLToNodeJSPath = new Map(); | 68 this._fileURLToNodeJSPath = new Map(); |
| 69 this.enableDebugger(); | 69 this.enableDebugger(); |
| 70 | 70 |
| 71 /** @type {!Map<string, string>} */ | 71 /** @type {!Map<string, string>} */ |
| 72 this._stringMap = new Map(); | 72 this._stringMap = new Map(); |
| 73 this._sourceMapManager.setEnabled(Common.moduleSetting('jsSourceMapsEnabled' ).get()); | 73 this._sourceMapManager.setEnabled(Common.moduleSetting('jsSourceMapsEnabled' ).get()); |
| 74 Common.moduleSetting('jsSourceMapsEnabled') | 74 Common.moduleSetting('jsSourceMapsEnabled') |
| 75 .addChangeListener(event => this._sourceMapManager.setEnabled(/** @type {boolean} */ (event.data))); | 75 .addChangeListener(event => this._sourceMapManager.setEnabled(/** @type {boolean} */ (event.data))); |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 169 if (!Common.moduleSetting('pauseOnExceptionEnabled').get()) | 169 if (!Common.moduleSetting('pauseOnExceptionEnabled').get()) |
| 170 state = SDK.DebuggerModel.PauseOnExceptionsState.DontPauseOnExceptions; | 170 state = SDK.DebuggerModel.PauseOnExceptionsState.DontPauseOnExceptions; |
| 171 else if (Common.moduleSetting('pauseOnCaughtException').get()) | 171 else if (Common.moduleSetting('pauseOnCaughtException').get()) |
| 172 state = SDK.DebuggerModel.PauseOnExceptionsState.PauseOnAllExceptions; | 172 state = SDK.DebuggerModel.PauseOnExceptionsState.PauseOnAllExceptions; |
| 173 else | 173 else |
| 174 state = SDK.DebuggerModel.PauseOnExceptionsState.PauseOnUncaughtExceptions ; | 174 state = SDK.DebuggerModel.PauseOnExceptionsState.PauseOnUncaughtExceptions ; |
| 175 | 175 |
| 176 this._agent.setPauseOnExceptions(state); | 176 this._agent.setPauseOnExceptions(state); |
| 177 } | 177 } |
| 178 | 178 |
| 179 asyncStackTracesStateChanged() { | 179 asyncStackTracesStateChanged() { |
|
dgozman
2017/04/21 23:39:17
While we are here, let's make this private.
kozy
2017/04/22 00:02:57
Done.
| |
| 180 const maxAsyncStackChainDepth = 8; | 180 const maxAsyncStackChainDepth = 32; |
| 181 var enabled = Common.moduleSetting('enableAsyncStackTraces').get() && this._ debuggerEnabled; | 181 var enabled = !Common.moduleSetting('disableAsyncStackTraces').get() && this ._debuggerEnabled; |
| 182 this._agent.setAsyncCallStackDepth(enabled ? maxAsyncStackChainDepth : 0); | 182 this._agent.setAsyncCallStackDepth(enabled ? maxAsyncStackChainDepth : 0); |
| 183 } | 183 } |
| 184 | 184 |
| 185 stepInto() { | 185 stepInto() { |
| 186 this._agent.stepInto(); | 186 this._agent.stepInto(); |
| 187 } | 187 } |
| 188 | 188 |
| 189 stepOver() { | 189 stepOver() { |
| 190 this._agent.stepOver(); | 190 this._agent.stepOver(); |
| 191 } | 191 } |
| (...skipping 665 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 857 } | 857 } |
| 858 } | 858 } |
| 859 | 859 |
| 860 /** | 860 /** |
| 861 * @override | 861 * @override |
| 862 */ | 862 */ |
| 863 dispose() { | 863 dispose() { |
| 864 this._sourceMapManager.dispose(); | 864 this._sourceMapManager.dispose(); |
| 865 Common.moduleSetting('pauseOnExceptionEnabled').removeChangeListener(this._p auseOnExceptionStateChanged, this); | 865 Common.moduleSetting('pauseOnExceptionEnabled').removeChangeListener(this._p auseOnExceptionStateChanged, this); |
| 866 Common.moduleSetting('pauseOnCaughtException').removeChangeListener(this._pa useOnExceptionStateChanged, this); | 866 Common.moduleSetting('pauseOnCaughtException').removeChangeListener(this._pa useOnExceptionStateChanged, this); |
| 867 Common.moduleSetting('enableAsyncStackTraces').removeChangeListener(this.asy ncStackTracesStateChanged, this); | 867 Common.moduleSetting('disableAsyncStackTraces').removeChangeListener(this.as yncStackTracesStateChanged, this); |
| 868 } | 868 } |
| 869 | 869 |
| 870 /** | 870 /** |
| 871 * @override | 871 * @override |
| 872 * @return {!Promise} | 872 * @return {!Promise} |
| 873 */ | 873 */ |
| 874 suspendModel() { | 874 suspendModel() { |
| 875 return new Promise(promiseBody.bind(this)); | 875 return new Promise(promiseBody.bind(this)); |
| 876 | 876 |
| 877 /** | 877 /** |
| (...skipping 602 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1480 stack.callFrames.shift(); | 1480 stack.callFrames.shift(); |
| 1481 if (previous && (!stack.callFrames.length && !stack.promiseCreationFrame)) | 1481 if (previous && (!stack.callFrames.length && !stack.promiseCreationFrame)) |
| 1482 previous.parent = stack.parent; | 1482 previous.parent = stack.parent; |
| 1483 else | 1483 else |
| 1484 previous = stack; | 1484 previous = stack; |
| 1485 stack = stack.parent; | 1485 stack = stack.parent; |
| 1486 } | 1486 } |
| 1487 return asyncStackTrace; | 1487 return asyncStackTrace; |
| 1488 } | 1488 } |
| 1489 }; | 1489 }; |
| OLD | NEW |