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 221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
232 this._sourceMapForScriptId.set(script.scriptId, sourceMap); | 232 this._sourceMapForScriptId.set(script.scriptId, sourceMap); |
233 this._debuggerWorkspaceBinding.updateLocations(script); | 233 this._debuggerWorkspaceBinding.updateLocations(script); |
234 return; | 234 return; |
235 } | 235 } |
236 | 236 |
237 this._sourceMapForScriptId.set(script.scriptId, sourceMap); | 237 this._sourceMapForScriptId.set(script.scriptId, sourceMap); |
238 this._scriptForSourceMap.set(sourceMap, script); | 238 this._scriptForSourceMap.set(sourceMap, script); |
239 | 239 |
240 // Report sources. | 240 // Report sources. |
241 var missingSources = []; | 241 var missingSources = []; |
242 var frame = SDK.ResourceTreeFrame.fromScript(script); | |
243 var frameId = frame ? frame.id : ''; | |
242 for (var sourceURL of sourceMap.sourceURLs()) { | 244 for (var sourceURL of sourceMap.sourceURLs()) { |
243 if (this._sourceMapForURL.get(sourceURL)) | 245 if (this._sourceMapForURL.get(sourceURL)) |
244 continue; | 246 continue; |
245 this._sourceMapForURL.set(sourceURL, sourceMap); | 247 this._sourceMapForURL.set(sourceURL, sourceMap); |
246 var uiSourceCode = Bindings.NetworkProject.uiSourceCodeForScriptURL(this._ workspace, sourceURL, script); | 248 var uiSourceCode = Bindings.NetworkProject.uiSourceCodeForScriptURL(this._ workspace, sourceURL, script); |
247 if (!uiSourceCode) { | 249 if (!uiSourceCode) { |
248 var contentProvider = sourceMap.sourceContentProvider(sourceURL, Common. resourceTypes.SourceMapScript); | 250 var contentProvider = sourceMap.sourceContentProvider(sourceURL, Common. resourceTypes.SourceMapScript); |
249 var embeddedContent = sourceMap.embeddedContentByURL(sourceURL); | 251 var embeddedContent = sourceMap.embeddedContentByURL(sourceURL); |
250 var embeddedContentLength = typeof embeddedContent === 'string' ? embedd edContent.length : null; | 252 var embeddedContentLength = typeof embeddedContent === 'string' ? embedd edContent.length : null; |
251 uiSourceCode = this._networkProject.addSourceMapFile( | 253 uiSourceCode = this._networkProject.addSourceMapFile( |
252 contentProvider, SDK.ResourceTreeFrame.fromScript(script), script.is ContentScript(), embeddedContentLength); | 254 contentProvider, frameId, script.isContentScript(), embeddedContentL ength); |
253 uiSourceCode[Bindings.CompilerScriptMapping._originSymbol] = script.sour ceURL; | 255 uiSourceCode[Bindings.CompilerScriptMapping._originSymbol] = script.sour ceURL; |
254 } | 256 } |
255 if (uiSourceCode) { | 257 if (uiSourceCode) { |
256 this._bindUISourceCode(uiSourceCode); | 258 this._bindUISourceCode(uiSourceCode); |
257 } else { | 259 } else { |
258 if (missingSources.length < 3) | 260 if (missingSources.length < 3) |
259 missingSources.push(sourceURL); | 261 missingSources.push(sourceURL); |
260 else if (missingSources.peekLast() !== '\u2026') | 262 else if (missingSources.peekLast() !== '\u2026') |
261 missingSources.push('\u2026'); | 263 missingSources.push('\u2026'); |
262 } | 264 } |
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
380 } | 382 } |
381 | 383 |
382 dispose() { | 384 dispose() { |
383 Common.EventTarget.removeEventListeners(this._eventListeners); | 385 Common.EventTarget.removeEventListeners(this._eventListeners); |
384 this._debuggerReset(); | 386 this._debuggerReset(); |
385 this._stubProject.dispose(); | 387 this._stubProject.dispose(); |
386 } | 388 } |
387 }; | 389 }; |
388 | 390 |
389 Bindings.CompilerScriptMapping._originSymbol = Symbol('origin'); | 391 Bindings.CompilerScriptMapping._originSymbol = Symbol('origin'); |
392 Bindings.CompilerScriptMapping._frameSymbol = Symbol('Bindings.CompilerScriptMap ping._frameSymbol'); | |
dgozman
2017/03/17 19:00:21
Unused.
lushnikov
2017/03/17 21:21:47
Done.
| |
OLD | NEW |