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.addSourceMapFile( | 67 this._networkProject.addSourceMapFile(contentProvider, header.frameId, fal
se, embeddedContentLength); |
68 contentProvider, SDK.ResourceTreeFrame.fromStyleSheet(header), false,
embeddedContentLength); | |
69 } | 68 } |
70 Bindings.cssWorkspaceBinding.updateLocations(header); | 69 Bindings.cssWorkspaceBinding.updateLocations(header); |
71 this._sourceMapAttachedForTest(sourceMap); | 70 this._sourceMapAttachedForTest(sourceMap); |
72 } | 71 } |
73 | 72 |
74 /** | 73 /** |
75 * @param {!Common.Event} event | 74 * @param {!Common.Event} event |
76 */ | 75 */ |
77 _sourceMapDetached(event) { | 76 _sourceMapDetached(event) { |
78 var header = /** @type {!SDK.CSSStyleSheetHeader} */ (event.data); | 77 var header = /** @type {!SDK.CSSStyleSheetHeader} */ (event.data); |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
120 return null; | 119 return null; |
121 var uiSourceCode = Bindings.NetworkProject.uiSourceCodeForStyleURL(this._wor
kspace, entry.sourceURL, header); | 120 var uiSourceCode = Bindings.NetworkProject.uiSourceCodeForStyleURL(this._wor
kspace, entry.sourceURL, header); |
122 if (!uiSourceCode) | 121 if (!uiSourceCode) |
123 return null; | 122 return null; |
124 return uiSourceCode.uiLocation(entry.sourceLineNumber || 0, entry.sourceColu
mnNumber); | 123 return uiSourceCode.uiLocation(entry.sourceLineNumber || 0, entry.sourceColu
mnNumber); |
125 } | 124 } |
126 | 125 |
127 dispose() { | 126 dispose() { |
128 Common.EventTarget.removeEventListeners(this._eventListeners); | 127 Common.EventTarget.removeEventListeners(this._eventListeners); |
129 } | 128 } |
130 }; | 129 }; |
OLD | NEW |