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 20 matching lines...) Expand all Loading... |
31 /** | 31 /** |
32 * @constructor | 32 * @constructor |
33 * @implements {WebInspector.ScriptSourceMapping} | 33 * @implements {WebInspector.ScriptSourceMapping} |
34 * @param {!WebInspector.DebuggerModel} debuggerModel | 34 * @param {!WebInspector.DebuggerModel} debuggerModel |
35 * @param {!WebInspector.Workspace} workspace | 35 * @param {!WebInspector.Workspace} workspace |
36 */ | 36 */ |
37 WebInspector.DefaultScriptMapping = function(debuggerModel, workspace) | 37 WebInspector.DefaultScriptMapping = function(debuggerModel, workspace) |
38 { | 38 { |
39 this._debuggerModel = debuggerModel; | 39 this._debuggerModel = debuggerModel; |
40 this._workspace = workspace; | 40 this._workspace = workspace; |
41 this._projectId = "debugger:" + debuggerModel.target().id(); | 41 this._projectId = WebInspector.DefaultScriptMapping.projectIdForTarget(debug
gerModel.target()); |
42 this._projectDelegate = new WebInspector.DebuggerProjectDelegate(this._works
pace, this._projectId, WebInspector.projectTypes.Debugger); | 42 this._projectDelegate = new WebInspector.DebuggerProjectDelegate(this._works
pace, this._projectId, WebInspector.projectTypes.Debugger); |
43 debuggerModel.addEventListener(WebInspector.DebuggerModel.Events.GlobalObjec
tCleared, this._debuggerReset, this); | 43 debuggerModel.addEventListener(WebInspector.DebuggerModel.Events.GlobalObjec
tCleared, this._debuggerReset, this); |
44 this._debuggerReset(); | 44 this._debuggerReset(); |
45 } | 45 } |
46 | 46 |
47 WebInspector.DefaultScriptMapping.prototype = { | 47 WebInspector.DefaultScriptMapping.prototype = { |
48 /** | 48 /** |
49 * @param {!WebInspector.RawLocation} rawLocation | 49 * @param {!WebInspector.RawLocation} rawLocation |
50 * @return {!WebInspector.UILocation} | 50 * @return {!WebInspector.UILocation} |
51 */ | 51 */ |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
116 this._projectDelegate.reset(); | 116 this._projectDelegate.reset(); |
117 }, | 117 }, |
118 | 118 |
119 dispose: function() | 119 dispose: function() |
120 { | 120 { |
121 this._workspace.removeProject(this._projectId); | 121 this._workspace.removeProject(this._projectId); |
122 } | 122 } |
123 } | 123 } |
124 | 124 |
125 /** | 125 /** |
| 126 * @param {!WebInspector.Target} target |
| 127 * @return {string} |
| 128 */ |
| 129 WebInspector.DefaultScriptMapping.projectIdForTarget = function(target) |
| 130 { |
| 131 return "debugger:" + target.id(); |
| 132 } |
| 133 |
| 134 /** |
126 * @constructor | 135 * @constructor |
127 * @param {!WebInspector.Workspace} workspace | 136 * @param {!WebInspector.Workspace} workspace |
128 * @param {string} id | 137 * @param {string} id |
129 * @param {!WebInspector.projectTypes} type | 138 * @param {!WebInspector.projectTypes} type |
130 * @extends {WebInspector.ContentProviderBasedProjectDelegate} | 139 * @extends {WebInspector.ContentProviderBasedProjectDelegate} |
131 */ | 140 */ |
132 WebInspector.DebuggerProjectDelegate = function(workspace, id, type) | 141 WebInspector.DebuggerProjectDelegate = function(workspace, id, type) |
133 { | 142 { |
134 WebInspector.ContentProviderBasedProjectDelegate.call(this, workspace, id, t
ype); | 143 WebInspector.ContentProviderBasedProjectDelegate.call(this, workspace, id, t
ype); |
135 } | 144 } |
(...skipping 15 matching lines...) Expand all Loading... |
151 { | 160 { |
152 var contentProvider = script.isInlineScript() ? new WebInspector.Concate
natedScriptsContentProvider([script]) : script; | 161 var contentProvider = script.isInlineScript() ? new WebInspector.Concate
natedScriptsContentProvider([script]) : script; |
153 var splitURL = WebInspector.ParsedURL.splitURL(script.sourceURL); | 162 var splitURL = WebInspector.ParsedURL.splitURL(script.sourceURL); |
154 var name = splitURL[splitURL.length - 1]; | 163 var name = splitURL[splitURL.length - 1]; |
155 name = "VM" + script.scriptId + (name ? " " + name : ""); | 164 name = "VM" + script.scriptId + (name ? " " + name : ""); |
156 return this.addContentProvider("", name, script.sourceURL, contentProvid
er); | 165 return this.addContentProvider("", name, script.sourceURL, contentProvid
er); |
157 }, | 166 }, |
158 | 167 |
159 __proto__: WebInspector.ContentProviderBasedProjectDelegate.prototype | 168 __proto__: WebInspector.ContentProviderBasedProjectDelegate.prototype |
160 } | 169 } |
OLD | NEW |