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 16 matching lines...) Expand all Loading... |
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
29 */ | 29 */ |
30 | 30 |
31 /** | 31 /** |
32 * @unrestricted | 32 * @unrestricted |
33 */ | 33 */ |
34 SDK.DebuggerModel = class extends SDK.SDKModel { | 34 SDK.DebuggerModel = class extends SDK.SDKModel { |
35 /** | 35 /** |
36 * @param {!SDK.Target} target | 36 * @param {!SDK.Target} target |
| 37 * @param {!Protocol.Dispatcher} dispatcher |
37 */ | 38 */ |
38 constructor(target) { | 39 constructor(target, dispatcher) { |
39 super(target); | 40 super(target, dispatcher); |
40 | 41 |
41 target.registerDebuggerDispatcher(new SDK.DebuggerDispatcher(this)); | 42 dispatcher.registerDebuggerDispatcher(new SDK.DebuggerDispatcher(this)); |
42 this._agent = target.debuggerAgent(); | 43 this._agent = dispatcher.debuggerAgent(); |
43 this._runtimeModel = /** @type {!SDK.RuntimeModel} */ (target.model(SDK.Runt
imeModel)); | 44 this._runtimeModel = /** @type {!SDK.RuntimeModel} */ (target.model(SDK.Runt
imeModel)); |
44 | 45 |
45 /** @type {!SDK.SourceMapManager<!SDK.Script>} */ | 46 /** @type {!SDK.SourceMapManager<!SDK.Script>} */ |
46 this._sourceMapManager = new SDK.SourceMapManager(target); | 47 this._sourceMapManager = new SDK.SourceMapManager(target); |
47 /** @type {!Map<string, !SDK.Script>} */ | 48 /** @type {!Map<string, !SDK.Script>} */ |
48 this._sourceMapIdToScript = new Map(); | 49 this._sourceMapIdToScript = new Map(); |
49 | 50 |
50 /** @type {?SDK.DebuggerPausedDetails} */ | 51 /** @type {?SDK.DebuggerPausedDetails} */ |
51 this._debuggerPausedDetails = null; | 52 this._debuggerPausedDetails = null; |
52 /** @type {!Map<string, !SDK.Script>} */ | 53 /** @type {!Map<string, !SDK.Script>} */ |
(...skipping 450 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
503 // Support file URL for node.js. | 504 // Support file URL for node.js. |
504 if (this.target().isNodeJS() && sourceURL && sourceURL.startsWith('/')) { | 505 if (this.target().isNodeJS() && sourceURL && sourceURL.startsWith('/')) { |
505 var nodeJSPath = sourceURL; | 506 var nodeJSPath = sourceURL; |
506 sourceURL = Common.ParsedURL.platformPathToURL(nodeJSPath); | 507 sourceURL = Common.ParsedURL.platformPathToURL(nodeJSPath); |
507 sourceURL = this._internString(sourceURL); | 508 sourceURL = this._internString(sourceURL); |
508 this._fileURLToNodeJSPath.set(sourceURL, nodeJSPath); | 509 this._fileURLToNodeJSPath.set(sourceURL, nodeJSPath); |
509 } else { | 510 } else { |
510 sourceURL = this._internString(sourceURL); | 511 sourceURL = this._internString(sourceURL); |
511 } | 512 } |
512 var script = new SDK.Script( | 513 var script = new SDK.Script( |
513 this, scriptId, sourceURL, startLine, startColumn, endLine, endColumn, e
xecutionContextId, | 514 this, this._agent, scriptId, sourceURL, startLine, startColumn, endLine,
endColumn, executionContextId, |
514 this._internString(hash), isContentScript, isLiveEdit, sourceMapURL, has
SourceURL, length); | 515 this._internString(hash), isContentScript, isLiveEdit, sourceMapURL, has
SourceURL, length); |
515 this._registerScript(script); | 516 this._registerScript(script); |
516 if (!hasSyntaxError) | 517 if (!hasSyntaxError) |
517 this.dispatchEventToListeners(SDK.DebuggerModel.Events.ParsedScriptSource,
script); | 518 this.dispatchEventToListeners(SDK.DebuggerModel.Events.ParsedScriptSource,
script); |
518 else | 519 else |
519 this.dispatchEventToListeners(SDK.DebuggerModel.Events.FailedToParseScript
Source, script); | 520 this.dispatchEventToListeners(SDK.DebuggerModel.Events.FailedToParseScript
Source, script); |
520 | 521 |
521 var sourceMapId = SDK.DebuggerModel._sourceMapId(script.executionContextId,
script.sourceURL, script.sourceMapURL); | 522 var sourceMapId = SDK.DebuggerModel._sourceMapId(script.executionContextId,
script.sourceURL, script.sourceMapURL); |
522 if (sourceMapId && !hasSyntaxError) { | 523 if (sourceMapId && !hasSyntaxError) { |
523 // Consecutive script evaluations in the same execution context with the s
ame sourceURL | 524 // Consecutive script evaluations in the same execution context with the s
ame sourceURL |
(...skipping 939 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1463 stack.callFrames.shift(); | 1464 stack.callFrames.shift(); |
1464 if (previous && (!stack.callFrames.length && !stack.promiseCreationFrame)) | 1465 if (previous && (!stack.callFrames.length && !stack.promiseCreationFrame)) |
1465 previous.parent = stack.parent; | 1466 previous.parent = stack.parent; |
1466 else | 1467 else |
1467 previous = stack; | 1468 previous = stack; |
1468 stack = stack.parent; | 1469 stack = stack.parent; |
1469 } | 1470 } |
1470 return asyncStackTrace; | 1471 return asyncStackTrace; |
1471 } | 1472 } |
1472 }; | 1473 }; |
OLD | NEW |