| 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 17 matching lines...) Expand all Loading... |
| 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 * @implements {Bindings.DebuggerSourceMapping} | 31 * @implements {Bindings.DebuggerSourceMapping} |
| 32 * @unrestricted | 32 * @unrestricted |
| 33 */ | 33 */ |
| 34 Bindings.ResourceScriptMapping = class { | 34 Bindings.ResourceScriptMapping = class { |
| 35 /** | 35 /** |
| 36 * @param {!SDK.DebuggerModel} debuggerModel | 36 * @param {!SDK.DebuggerModel} debuggerModel |
| 37 * @param {!Workspace.Workspace} workspace | 37 * @param {!Workspace.Workspace} workspace |
| 38 * @param {!Bindings.NetworkMapping} networkMapping | |
| 39 * @param {!Bindings.DebuggerWorkspaceBinding} debuggerWorkspaceBinding | 38 * @param {!Bindings.DebuggerWorkspaceBinding} debuggerWorkspaceBinding |
| 40 */ | 39 */ |
| 41 constructor(debuggerModel, workspace, networkMapping, debuggerWorkspaceBinding
) { | 40 constructor(debuggerModel, workspace, debuggerWorkspaceBinding) { |
| 42 this._target = debuggerModel.target(); | 41 this._target = debuggerModel.target(); |
| 43 this._debuggerModel = debuggerModel; | 42 this._debuggerModel = debuggerModel; |
| 44 this._networkMapping = networkMapping; | 43 this._workspace = workspace; |
| 45 this._debuggerWorkspaceBinding = debuggerWorkspaceBinding; | 44 this._debuggerWorkspaceBinding = debuggerWorkspaceBinding; |
| 46 /** @type {!Set<!Workspace.UISourceCode>} */ | 45 /** @type {!Set<!Workspace.UISourceCode>} */ |
| 47 this._boundUISourceCodes = new Set(); | 46 this._boundUISourceCodes = new Set(); |
| 48 | 47 |
| 49 /** @type {!Map.<!Workspace.UISourceCode, !Bindings.ResourceScriptFile>} */ | 48 /** @type {!Map.<!Workspace.UISourceCode, !Bindings.ResourceScriptFile>} */ |
| 50 this._uiSourceCodeToScriptFile = new Map(); | 49 this._uiSourceCodeToScriptFile = new Map(); |
| 51 | 50 |
| 52 this._eventListeners = [ | 51 this._eventListeners = [ |
| 53 debuggerModel.addEventListener(SDK.DebuggerModel.Events.GlobalObjectCleare
d, this._debuggerReset, this), | 52 debuggerModel.addEventListener(SDK.DebuggerModel.Events.GlobalObjectCleare
d, this._debuggerReset, this), |
| 54 workspace.addEventListener(Workspace.Workspace.Events.UISourceCodeAdded, t
his._uiSourceCodeAdded, this), | 53 workspace.addEventListener(Workspace.Workspace.Events.UISourceCodeAdded, t
his._uiSourceCodeAdded, this), |
| (...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 186 this._debuggerWorkspaceBinding.updateLocations(scripts[i]); | 185 this._debuggerWorkspaceBinding.updateLocations(scripts[i]); |
| 187 } | 186 } |
| 188 | 187 |
| 189 /** | 188 /** |
| 190 * @param {!SDK.Script} script | 189 * @param {!SDK.Script} script |
| 191 * @return {?Workspace.UISourceCode} | 190 * @return {?Workspace.UISourceCode} |
| 192 */ | 191 */ |
| 193 _workspaceUISourceCodeForScript(script) { | 192 _workspaceUISourceCodeForScript(script) { |
| 194 if (script.isAnonymousScript()) | 193 if (script.isAnonymousScript()) |
| 195 return null; | 194 return null; |
| 196 return this._networkMapping.uiSourceCodeForScriptURL(script.sourceURL, scrip
t); | 195 return Bindings.NetworkProject.uiSourceCodeForScriptURL(this._workspace, scr
ipt.sourceURL, script); |
| 197 } | 196 } |
| 198 | 197 |
| 199 /** | 198 /** |
| 200 * @param {!Workspace.UISourceCode} uiSourceCode | 199 * @param {!Workspace.UISourceCode} uiSourceCode |
| 201 * @return {!Array.<!SDK.Script>} | 200 * @return {!Array.<!SDK.Script>} |
| 202 */ | 201 */ |
| 203 _scriptsForUISourceCode(uiSourceCode) { | 202 _scriptsForUISourceCode(uiSourceCode) { |
| 204 var target = Bindings.NetworkProject.targetForUISourceCode(uiSourceCode); | 203 var target = Bindings.NetworkProject.targetForUISourceCode(uiSourceCode); |
| 205 if (target !== this._debuggerModel.target()) | 204 if (target !== this._debuggerModel.target()) |
| 206 return []; | 205 return []; |
| (...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 440 hasSourceMapURL() { | 439 hasSourceMapURL() { |
| 441 return this._script && !!this._script.sourceMapURL; | 440 return this._script && !!this._script.sourceMapURL; |
| 442 } | 441 } |
| 443 }; | 442 }; |
| 444 | 443 |
| 445 /** @enum {symbol} */ | 444 /** @enum {symbol} */ |
| 446 Bindings.ResourceScriptFile.Events = { | 445 Bindings.ResourceScriptFile.Events = { |
| 447 DidMergeToVM: Symbol('DidMergeToVM'), | 446 DidMergeToVM: Symbol('DidMergeToVM'), |
| 448 DidDivergeFromVM: Symbol('DidDivergeFromVM'), | 447 DidDivergeFromVM: Symbol('DidDivergeFromVM'), |
| 449 }; | 448 }; |
| OLD | NEW |