| 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 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 57 /** | 57 /** |
| 58 * @param {!Common.Event} event | 58 * @param {!Common.Event} event |
| 59 */ | 59 */ |
| 60 _sourceMapAttached(event) { | 60 _sourceMapAttached(event) { |
| 61 var header = /** @type {!SDK.CSSStyleSheetHeader} */ (event.data); | 61 var header = /** @type {!SDK.CSSStyleSheetHeader} */ (event.data); |
| 62 var sourceMap = this._cssModel.sourceMapForHeader(header); | 62 var sourceMap = this._cssModel.sourceMapForHeader(header); |
| 63 for (var sassURL of sourceMap.sourceURLs()) { | 63 for (var sassURL of sourceMap.sourceURLs()) { |
| 64 var contentProvider = sourceMap.sourceContentProvider(sassURL, Common.reso
urceTypes.SourceMapStyleSheet); | 64 var contentProvider = sourceMap.sourceContentProvider(sassURL, Common.reso
urceTypes.SourceMapStyleSheet); |
| 65 var embeddedContent = sourceMap.embeddedContentByURL(sassURL); | 65 var embeddedContent = sourceMap.embeddedContentByURL(sassURL); |
| 66 var embeddedContentLength = typeof embeddedContent === 'string' ? embedded
Content.length : null; | 66 var embeddedContentLength = typeof embeddedContent === 'string' ? embedded
Content.length : null; |
| 67 this._networkProject.addFile( | 67 this._networkProject.addSourceMapFile( |
| 68 contentProvider, SDK.ResourceTreeFrame.fromStyleSheet(header), false,
embeddedContentLength); | 68 contentProvider, SDK.ResourceTreeFrame.fromStyleSheet(header), false,
embeddedContentLength); |
| 69 } | 69 } |
| 70 Bindings.cssWorkspaceBinding.updateLocations(header); | 70 Bindings.cssWorkspaceBinding.updateLocations(header); |
| 71 this._sourceMapAttachedForTest(sourceMap); | 71 this._sourceMapAttachedForTest(sourceMap); |
| 72 } | 72 } |
| 73 | 73 |
| 74 /** | 74 /** |
| 75 * @param {!Common.Event} event | 75 * @param {!Common.Event} event |
| 76 */ | 76 */ |
| 77 _sourceMapDetached(event) { | 77 _sourceMapDetached(event) { |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 121 var uiSourceCode = Bindings.NetworkProject.uiSourceCodeForStyleURL(this._wor
kspace, entry.sourceURL, header); | 121 var uiSourceCode = Bindings.NetworkProject.uiSourceCodeForStyleURL(this._wor
kspace, entry.sourceURL, header); |
| 122 if (!uiSourceCode) | 122 if (!uiSourceCode) |
| 123 return null; | 123 return null; |
| 124 return uiSourceCode.uiLocation(entry.sourceLineNumber || 0, entry.sourceColu
mnNumber); | 124 return uiSourceCode.uiLocation(entry.sourceLineNumber || 0, entry.sourceColu
mnNumber); |
| 125 } | 125 } |
| 126 | 126 |
| 127 dispose() { | 127 dispose() { |
| 128 Common.EventTarget.removeEventListeners(this._eventListeners); | 128 Common.EventTarget.removeEventListeners(this._eventListeners); |
| 129 } | 129 } |
| 130 }; | 130 }; |
| OLD | NEW |