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 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
118 */ | 118 */ |
119 debuggerEnabled: function() | 119 debuggerEnabled: function() |
120 { | 120 { |
121 return !!this._debuggerEnabled; | 121 return !!this._debuggerEnabled; |
122 }, | 122 }, |
123 | 123 |
124 enableDebugger: function() | 124 enableDebugger: function() |
125 { | 125 { |
126 if (this._debuggerEnabled) | 126 if (this._debuggerEnabled) |
127 return; | 127 return; |
128 this._agent.enable(); | 128 this._agent.enable(this._wasEnabled.bind(this)); |
129 this._debuggerEnabled = true; | |
130 if (this._hasStaleState) { | 129 if (this._hasStaleState) { |
131 this._globalObjectCleared(); | 130 this._globalObjectCleared(); |
132 this._hasStaleState = false; | 131 this._hasStaleState = false; |
133 } | 132 } |
134 this._pauseOnExceptionStateChanged(); | 133 this._pauseOnExceptionStateChanged(); |
yurys
2015/07/16 16:30:35
I'd expect all of these code to be executed after
dgozman
2015/07/17 14:39:16
Done.
| |
135 this.asyncStackTracesStateChanged(); | 134 this.asyncStackTracesStateChanged(); |
135 }, | |
136 | |
137 /** | |
138 * @param {?Protocol.Error} error | |
139 */ | |
140 _wasEnabled: function(error) | |
141 { | |
142 if (error) | |
143 console.error(error); | |
144 this._debuggerEnabled = true; | |
136 this.dispatchEventToListeners(WebInspector.DebuggerModel.Events.Debugger WasEnabled); | 145 this.dispatchEventToListeners(WebInspector.DebuggerModel.Events.Debugger WasEnabled); |
137 }, | 146 }, |
138 | 147 |
139 disableDebugger: function() | 148 disableDebugger: function() |
140 { | 149 { |
141 if (!this._debuggerEnabled) | 150 if (!this._debuggerEnabled) |
142 return; | 151 return; |
143 | 152 |
144 this._hasStaleState = true; | 153 this._hasStaleState = true; |
145 this._agent.disable(); | 154 this._agent.disable(); |
(...skipping 1308 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1454 /** | 1463 /** |
1455 * @param {?WebInspector.Target} target | 1464 * @param {?WebInspector.Target} target |
1456 * @return {?WebInspector.DebuggerModel} | 1465 * @return {?WebInspector.DebuggerModel} |
1457 */ | 1466 */ |
1458 WebInspector.DebuggerModel.fromTarget = function(target) | 1467 WebInspector.DebuggerModel.fromTarget = function(target) |
1459 { | 1468 { |
1460 if (!target || !target.hasJSContext()) | 1469 if (!target || !target.hasJSContext()) |
1461 return null; | 1470 return null; |
1462 return /** @type {?WebInspector.DebuggerModel} */ (target.model(WebInspector .DebuggerModel)); | 1471 return /** @type {?WebInspector.DebuggerModel} */ (target.model(WebInspector .DebuggerModel)); |
1463 } | 1472 } |
OLD | NEW |