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 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
54 /** @type {!Object.<string, !WebInspector.SourceMap>} */ | 54 /** @type {!Object.<string, !WebInspector.SourceMap>} */ |
55 this._sourceMapForScriptId = {}; | 55 this._sourceMapForScriptId = {}; |
56 /** @type {!Map.<!WebInspector.SourceMap, !WebInspector.Script>} */ | 56 /** @type {!Map.<!WebInspector.SourceMap, !WebInspector.Script>} */ |
57 this._scriptForSourceMap = new Map(); | 57 this._scriptForSourceMap = new Map(); |
58 /** @type {!Map.<string, !WebInspector.SourceMap>} */ | 58 /** @type {!Map.<string, !WebInspector.SourceMap>} */ |
59 this._sourceMapForURL = new Map(); | 59 this._sourceMapForURL = new Map(); |
60 /** @type {!Map.<string, !WebInspector.UISourceCode>} */ | 60 /** @type {!Map.<string, !WebInspector.UISourceCode>} */ |
61 this._stubUISourceCodes = new Map(); | 61 this._stubUISourceCodes = new Map(); |
62 | 62 |
63 this._stubProjectID = "compiler-script-project"; | 63 this._stubProjectID = "compiler-script-project"; |
64 this._stubProject = new WebInspector.ContentProviderBasedProject(this._works
pace, this._stubProjectID, WebInspector.projectTypes.Service, "", ""); | 64 this._stubProject = new WebInspector.ContentProviderBasedProject(this._works
pace, this._stubProjectID, WebInspector.projectTypes.Service, ""); |
65 debuggerModel.addEventListener(WebInspector.DebuggerModel.Events.GlobalObjec
tCleared, this._debuggerReset, this); | 65 debuggerModel.addEventListener(WebInspector.DebuggerModel.Events.GlobalObjec
tCleared, this._debuggerReset, this); |
66 } | 66 } |
67 | 67 |
68 WebInspector.CompilerScriptMapping.StubProjectID = "compiler-script-project"; | 68 WebInspector.CompilerScriptMapping.StubProjectID = "compiler-script-project"; |
69 | 69 |
70 WebInspector.CompilerScriptMapping.prototype = { | 70 WebInspector.CompilerScriptMapping.prototype = { |
71 /** | 71 /** |
72 * @param {!WebInspector.DebuggerModel.Location} rawLocation | 72 * @param {!WebInspector.DebuggerModel.Location} rawLocation |
73 * @return {boolean} | 73 * @return {boolean} |
74 */ | 74 */ |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
155 return; | 155 return; |
156 this._processScript(script); | 156 this._processScript(script); |
157 }, | 157 }, |
158 | 158 |
159 /** | 159 /** |
160 * @param {!WebInspector.Script} script | 160 * @param {!WebInspector.Script} script |
161 */ | 161 */ |
162 _processScript: function(script) | 162 _processScript: function(script) |
163 { | 163 { |
164 // Create stub UISourceCode for the time source mapping is being loaded. | 164 // Create stub UISourceCode for the time source mapping is being loaded. |
165 var url = script.sourceURL; | 165 var stubUISourceCode = this._stubProject.addContentProvider(script.sourc
eURL, new WebInspector.StaticContentProvider(WebInspector.resourceTypes.Script,
"\n\n\n\n\n// Please wait a bit.\n// Compiled script is not shown while source m
ap is being loaded!", script.sourceURL)); |
166 var splitURL = WebInspector.ParsedURL.splitURLIntoPathComponents(url); | |
167 var parentPath = splitURL.slice(1, -1).join("/"); | |
168 var name = splitURL.peekLast() || ""; | |
169 var stubUISourceCode = this._stubProject.addContentProvider(parentPath,
name, url, new WebInspector.StaticContentProvider(WebInspector.resourceTypes.Scr
ipt, "\n\n\n\n\n// Please wait a bit.\n// Compiled script is not shown while sou
rce map is being loaded!", url)); | |
170 this._stubUISourceCodes.set(script.scriptId, stubUISourceCode); | 166 this._stubUISourceCodes.set(script.scriptId, stubUISourceCode); |
171 | 167 |
172 this._debuggerWorkspaceBinding.pushSourceMapping(script, this); | 168 this._debuggerWorkspaceBinding.pushSourceMapping(script, this); |
173 this._loadSourceMapForScript(script, this._sourceMapLoaded.bind(this, sc
ript, stubUISourceCode.path())); | 169 this._loadSourceMapForScript(script, this._sourceMapLoaded.bind(this, sc
ript, stubUISourceCode.path())); |
174 }, | 170 }, |
175 | 171 |
176 /** | 172 /** |
177 * @param {!WebInspector.Script} script | 173 * @param {!WebInspector.Script} script |
178 * @param {string} uiSourceCodePath | 174 * @param {string} uiSourceCodePath |
179 * @param {?WebInspector.SourceMap} sourceMap | 175 * @param {?WebInspector.SourceMap} sourceMap |
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
365 this._sourceMapForScriptId = {}; | 361 this._sourceMapForScriptId = {}; |
366 this._scriptForSourceMap.clear(); | 362 this._scriptForSourceMap.clear(); |
367 this._sourceMapForURL.clear(); | 363 this._sourceMapForURL.clear(); |
368 }, | 364 }, |
369 | 365 |
370 dispose: function() | 366 dispose: function() |
371 { | 367 { |
372 this._workspace.removeEventListener(WebInspector.Workspace.Events.UISour
ceCodeAdded, this._uiSourceCodeAddedToWorkspace, this); | 368 this._workspace.removeEventListener(WebInspector.Workspace.Events.UISour
ceCodeAdded, this._uiSourceCodeAddedToWorkspace, this); |
373 } | 369 } |
374 } | 370 } |
OLD | NEW |