| 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 23 matching lines...) Expand all Loading... |
| 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._project = new WebInspector.ContentProviderBasedProject(this._workspace
, this._projectId, WebInspector.projectTypes.Debugger, "debugger:", ""); | 44 this._project = new WebInspector.ContentProviderBasedProject(this._workspace
, 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 * @override | 51 * @override |
| 52 * @param {!WebInspector.DebuggerModel.Location} rawLocation | 52 * @param {!WebInspector.DebuggerModel.Location} rawLocation |
| 53 * @return {!WebInspector.UILocation} | 53 * @return {!WebInspector.UILocation} |
| 54 */ | 54 */ |
| (...skipping 25 matching lines...) Expand all Loading... |
| 80 return this._debuggerModel.createRawLocation(script, lineNumber, columnN
umber); | 80 return this._debuggerModel.createRawLocation(script, lineNumber, columnN
umber); |
| 81 }, | 81 }, |
| 82 | 82 |
| 83 /** | 83 /** |
| 84 * @param {!WebInspector.Script} script | 84 * @param {!WebInspector.Script} script |
| 85 */ | 85 */ |
| 86 addScript: function(script) | 86 addScript: function(script) |
| 87 { | 87 { |
| 88 | 88 |
| 89 var splitURL = WebInspector.ParsedURL.splitURLIntoPathComponents(script.
sourceURL); | 89 var splitURL = WebInspector.ParsedURL.splitURLIntoPathComponents(script.
sourceURL); |
| 90 var name = splitURL[splitURL.length - 1]; | 90 var url = splitURL[splitURL.length - 1]; |
| 91 name = "VM" + script.scriptId + (name ? " " + name : ""); | 91 url = "debugger:///VM" + script.scriptId + (url ? " " + url: ""); |
| 92 | 92 |
| 93 var uiSourceCode = this._project.createUISourceCode("", name, script.sou
rceURL, WebInspector.resourceTypes.Script); | 93 var uiSourceCode = this._project.createUISourceCode(url, WebInspector.re
sourceTypes.Script); |
| 94 this._uiSourceCodeForScriptId.set(script.scriptId, uiSourceCode); | 94 this._uiSourceCodeForScriptId.set(script.scriptId, uiSourceCode); |
| 95 this._scriptIdForUISourceCode.set(uiSourceCode, script.scriptId); | 95 this._scriptIdForUISourceCode.set(uiSourceCode, script.scriptId); |
| 96 this._project.addUISourceCodeWithProvider(uiSourceCode, script); | 96 this._project.addUISourceCodeWithProvider(uiSourceCode, script); |
| 97 | 97 |
| 98 this._debuggerWorkspaceBinding.setSourceMapping(this._debuggerModel.targ
et(), uiSourceCode, this); | 98 this._debuggerWorkspaceBinding.setSourceMapping(this._debuggerModel.targ
et(), uiSourceCode, this); |
| 99 this._debuggerWorkspaceBinding.pushSourceMapping(script, this); | 99 this._debuggerWorkspaceBinding.pushSourceMapping(script, this); |
| 100 }, | 100 }, |
| 101 | 101 |
| 102 /** | 102 /** |
| 103 * @override | 103 * @override |
| (...skipping 30 matching lines...) Expand all Loading... |
| 134 } | 134 } |
| 135 | 135 |
| 136 /** | 136 /** |
| 137 * @param {!WebInspector.Target} target | 137 * @param {!WebInspector.Target} target |
| 138 * @return {string} | 138 * @return {string} |
| 139 */ | 139 */ |
| 140 WebInspector.DefaultScriptMapping.projectIdForTarget = function(target) | 140 WebInspector.DefaultScriptMapping.projectIdForTarget = function(target) |
| 141 { | 141 { |
| 142 return "debugger:" + target.id(); | 142 return "debugger:" + target.id(); |
| 143 } | 143 } |
| OLD | NEW |