| 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 12 matching lines...) Expand all Loading... |
| 23 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | 23 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
| 24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | 24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
| 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
| 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 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 * @constructor | 32 * @constructor |
| 33 * @implements {WebInspector.ScriptSourceMapping} | 33 * @implements {WebInspector.DebuggerSourceMapping} |
| 34 * @param {!WebInspector.DebuggerModel} debuggerModel | 34 * @param {!WebInspector.DebuggerModel} debuggerModel |
| 35 * @param {!WebInspector.Workspace} workspace | 35 * @param {!WebInspector.Workspace} workspace |
| 36 * @param {!WebInspector.DebuggerWorkspaceBinding} debuggerWorkspaceBinding | 36 * @param {!WebInspector.DebuggerWorkspaceBinding} debuggerWorkspaceBinding |
| 37 */ | 37 */ |
| 38 WebInspector.DefaultScriptMapping = function(debuggerModel, workspace, debuggerW
orkspaceBinding) | 38 WebInspector.DefaultScriptMapping = function(debuggerModel, workspace, debuggerW
orkspaceBinding) |
| 39 { | 39 { |
| 40 this._debuggerModel = debuggerModel; | 40 this._debuggerModel = debuggerModel; |
| 41 this._debuggerWorkspaceBinding = debuggerWorkspaceBinding; | 41 this._debuggerWorkspaceBinding = debuggerWorkspaceBinding; |
| 42 this._workspace = workspace; | 42 this._workspace = workspace; |
| 43 this._projectId = WebInspector.DefaultScriptMapping.projectIdForTarget(debug
gerModel.target()); | 43 this._projectId = WebInspector.DefaultScriptMapping.projectIdForTarget(debug
gerModel.target()); |
| 44 this._projectDelegate = new WebInspector.DebuggerProjectDelegate(this._works
pace, this._projectId, WebInspector.projectTypes.Debugger); | 44 this._projectDelegate = new WebInspector.DebuggerProjectDelegate(this._works
pace, this._projectId, WebInspector.projectTypes.Debugger); |
| 45 debuggerModel.addEventListener(WebInspector.DebuggerModel.Events.GlobalObjec
tCleared, this._debuggerReset, this); | 45 debuggerModel.addEventListener(WebInspector.DebuggerModel.Events.GlobalObjec
tCleared, this._debuggerReset, this); |
| 46 this._debuggerReset(); | 46 this._debuggerReset(); |
| 47 } | 47 } |
| 48 | 48 |
| 49 WebInspector.DefaultScriptMapping.prototype = { | 49 WebInspector.DefaultScriptMapping.prototype = { |
| 50 /** | 50 /** |
| 51 * @param {!WebInspector.RawLocation} rawLocation | 51 * @param {!WebInspector.DebuggerModel.Location} rawLocation |
| 52 * @return {!WebInspector.UILocation} | 52 * @return {!WebInspector.UILocation} |
| 53 */ | 53 */ |
| 54 rawLocationToUILocation: function(rawLocation) | 54 rawLocationToUILocation: function(rawLocation) |
| 55 { | 55 { |
| 56 var debuggerModelLocation = /** @type {!WebInspector.DebuggerModel.Locat
ion} */ (rawLocation); | 56 var debuggerModelLocation = /** @type {!WebInspector.DebuggerModel.Locat
ion} */ (rawLocation); |
| 57 var script = debuggerModelLocation.script(); | 57 var script = debuggerModelLocation.script(); |
| 58 var uiSourceCode = this._uiSourceCodeForScriptId[script.scriptId]; | 58 var uiSourceCode = this._uiSourceCodeForScriptId[script.scriptId]; |
| 59 var lineNumber = debuggerModelLocation.lineNumber; | 59 var lineNumber = debuggerModelLocation.lineNumber; |
| 60 var columnNumber = debuggerModelLocation.columnNumber || 0; | 60 var columnNumber = debuggerModelLocation.columnNumber || 0; |
| 61 return uiSourceCode.uiLocation(lineNumber, columnNumber); | 61 return uiSourceCode.uiLocation(lineNumber, columnNumber); |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 172 { | 172 { |
| 173 var contentProvider = script.isInlineScript() ? new WebInspector.Concate
natedScriptsContentProvider([script]) : script; | 173 var contentProvider = script.isInlineScript() ? new WebInspector.Concate
natedScriptsContentProvider([script]) : script; |
| 174 var splitURL = WebInspector.ParsedURL.splitURL(script.sourceURL); | 174 var splitURL = WebInspector.ParsedURL.splitURL(script.sourceURL); |
| 175 var name = splitURL[splitURL.length - 1]; | 175 var name = splitURL[splitURL.length - 1]; |
| 176 name = "VM" + script.scriptId + (name ? " " + name : ""); | 176 name = "VM" + script.scriptId + (name ? " " + name : ""); |
| 177 return this.addContentProvider("", name, script.sourceURL, contentProvid
er); | 177 return this.addContentProvider("", name, script.sourceURL, contentProvid
er); |
| 178 }, | 178 }, |
| 179 | 179 |
| 180 __proto__: WebInspector.ContentProviderBasedProjectDelegate.prototype | 180 __proto__: WebInspector.ContentProviderBasedProjectDelegate.prototype |
| 181 } | 181 } |
| OLD | NEW |