| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 this._workspace = workspace; | 42 this._workspace = workspace; |
| 43 this._debuggerWorkspaceBinding = debuggerWorkspaceBinding; | 43 this._debuggerWorkspaceBinding = debuggerWorkspaceBinding; |
| 44 /** @type {!Set<!Workspace.UISourceCode>} */ | 44 /** @type {!Set<!Workspace.UISourceCode>} */ |
| 45 this._boundUISourceCodes = new Set(); | 45 this._boundUISourceCodes = new Set(); |
| 46 | 46 |
| 47 /** @type {!Map.<!Workspace.UISourceCode, !Bindings.ResourceScriptFile>} */ | 47 /** @type {!Map.<!Workspace.UISourceCode, !Bindings.ResourceScriptFile>} */ |
| 48 this._uiSourceCodeToScriptFile = new Map(); | 48 this._uiSourceCodeToScriptFile = new Map(); |
| 49 | 49 |
| 50 this._eventListeners = [ | 50 this._eventListeners = [ |
| 51 debuggerModel.addEventListener(SDK.DebuggerModel.Events.GlobalObjectCleare
d, this._debuggerReset, this), | 51 debuggerModel.addEventListener(SDK.DebuggerModel.Events.GlobalObjectCleare
d, this._debuggerReset, this), |
| 52 debuggerModel.addEventListener(SDK.DebuggerModel.Events.ParsedScriptSource
, this._parsedScriptSource, this), |
| 53 debuggerModel.addEventListener( |
| 54 SDK.DebuggerModel.Events.FailedToParseScriptSource, this._parsedScript
Source, this), |
| 52 workspace.addEventListener(Workspace.Workspace.Events.UISourceCodeAdded, t
his._uiSourceCodeAdded, this), | 55 workspace.addEventListener(Workspace.Workspace.Events.UISourceCodeAdded, t
his._uiSourceCodeAdded, this), |
| 53 workspace.addEventListener(Workspace.Workspace.Events.UISourceCodeRemoved,
this._uiSourceCodeRemoved, this) | 56 workspace.addEventListener(Workspace.Workspace.Events.UISourceCodeRemoved,
this._uiSourceCodeRemoved, this) |
| 54 ]; | 57 ]; |
| 55 } | 58 } |
| 56 | 59 |
| 57 /** | 60 /** |
| 58 * @override | 61 * @override |
| 59 * @param {!SDK.DebuggerModel.Location} rawLocation | 62 * @param {!SDK.DebuggerModel.Location} rawLocation |
| 60 * @return {?Workspace.UILocation} | 63 * @return {?Workspace.UILocation} |
| 61 */ | 64 */ |
| (...skipping 30 matching lines...) Expand all Loading... |
| 92 var script = scripts[scripts.length - 1]; | 95 var script = scripts[scripts.length - 1]; |
| 93 if (script.isInlineScriptWithSourceURL()) { | 96 if (script.isInlineScriptWithSourceURL()) { |
| 94 return this._debuggerModel.createRawLocationByURL( | 97 return this._debuggerModel.createRawLocationByURL( |
| 95 script.sourceURL, lineNumber + script.lineOffset, | 98 script.sourceURL, lineNumber + script.lineOffset, |
| 96 lineNumber ? columnNumber : columnNumber + script.columnOffset); | 99 lineNumber ? columnNumber : columnNumber + script.columnOffset); |
| 97 } | 100 } |
| 98 return this._debuggerModel.createRawLocationByURL(script.sourceURL, lineNumb
er, columnNumber); | 101 return this._debuggerModel.createRawLocationByURL(script.sourceURL, lineNumb
er, columnNumber); |
| 99 } | 102 } |
| 100 | 103 |
| 101 /** | 104 /** |
| 102 * @param {!SDK.Script} script | 105 * @param {!Common.Event} event |
| 103 */ | 106 */ |
| 104 addScript(script) { | 107 _parsedScriptSource(event) { |
| 108 var script = /** @type {!SDK.Script} */ (event.data); |
| 105 if (script.isAnonymousScript()) | 109 if (script.isAnonymousScript()) |
| 106 return; | 110 return; |
| 107 | 111 |
| 108 var uiSourceCode = this._workspaceUISourceCodeForScript(script); | 112 var uiSourceCode = this._workspaceUISourceCodeForScript(script); |
| 109 if (!uiSourceCode) | 113 if (!uiSourceCode) |
| 110 return; | 114 return; |
| 111 | 115 |
| 112 this._bindUISourceCodeToScripts(uiSourceCode, [script]); | 116 this._bindUISourceCodeToScripts(uiSourceCode, [script]); |
| 113 } | 117 } |
| 114 | 118 |
| (...skipping 302 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 417 hasSourceMapURL() { | 421 hasSourceMapURL() { |
| 418 return this._script && !!this._script.sourceMapURL; | 422 return this._script && !!this._script.sourceMapURL; |
| 419 } | 423 } |
| 420 }; | 424 }; |
| 421 | 425 |
| 422 /** @enum {symbol} */ | 426 /** @enum {symbol} */ |
| 423 Bindings.ResourceScriptFile.Events = { | 427 Bindings.ResourceScriptFile.Events = { |
| 424 DidMergeToVM: Symbol('DidMergeToVM'), | 428 DidMergeToVM: Symbol('DidMergeToVM'), |
| 425 DidDivergeFromVM: Symbol('DidDivergeFromVM'), | 429 DidDivergeFromVM: Symbol('DidDivergeFromVM'), |
| 426 }; | 430 }; |
| OLD | NEW |