| 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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 this._networkProject = networkProject; | 42 this._networkProject = networkProject; |
| 43 this._workspace = workspace; | 43 this._workspace = workspace; |
| 44 this._eventListeners = [ | 44 this._eventListeners = [ |
| 45 this._cssModel.addEventListener(SDK.CSSModel.Events.SourceMapAttached, thi
s._sourceMapAttached, this), | 45 this._cssModel.addEventListener(SDK.CSSModel.Events.SourceMapAttached, thi
s._sourceMapAttached, this), |
| 46 this._cssModel.addEventListener(SDK.CSSModel.Events.SourceMapDetached, thi
s._sourceMapDetached, this), | 46 this._cssModel.addEventListener(SDK.CSSModel.Events.SourceMapDetached, thi
s._sourceMapDetached, this), |
| 47 this._cssModel.addEventListener(SDK.CSSModel.Events.SourceMapChanged, this
._sourceMapChanged, this) | 47 this._cssModel.addEventListener(SDK.CSSModel.Events.SourceMapChanged, this
._sourceMapChanged, this) |
| 48 ]; | 48 ]; |
| 49 } | 49 } |
| 50 | 50 |
| 51 /** | 51 /** |
| 52 * @param {?SDK.SourceMap} sourceMap |
| 53 */ |
| 54 _sourceMapAttachedForTest(sourceMap) { |
| 55 } |
| 56 |
| 57 /** |
| 52 * @param {!Common.Event} event | 58 * @param {!Common.Event} event |
| 53 */ | 59 */ |
| 54 _sourceMapAttached(event) { | 60 _sourceMapAttached(event) { |
| 55 var header = /** @type {!SDK.CSSStyleSheetHeader} */ (event.data); | 61 var header = /** @type {!SDK.CSSStyleSheetHeader} */ (event.data); |
| 56 var sourceMap = this._cssModel.sourceMapForHeader(header); | 62 var sourceMap = this._cssModel.sourceMapForHeader(header); |
| 57 for (var sassURL of sourceMap.sourceURLs()) { | 63 for (var sassURL of sourceMap.sourceURLs()) { |
| 58 var contentProvider = sourceMap.sourceContentProvider(sassURL, Common.reso
urceTypes.SourceMapStyleSheet); | 64 var contentProvider = sourceMap.sourceContentProvider(sassURL, Common.reso
urceTypes.SourceMapStyleSheet); |
| 59 var embeddedContent = sourceMap.embeddedContentByURL(sassURL); | 65 var embeddedContent = sourceMap.embeddedContentByURL(sassURL); |
| 60 var embeddedContentLength = typeof embeddedContent === 'string' ? embedded
Content.length : null; | 66 var embeddedContentLength = typeof embeddedContent === 'string' ? embedded
Content.length : null; |
| 61 this._networkProject.addFile( | 67 this._networkProject.addFile( |
| 62 contentProvider, SDK.ResourceTreeFrame.fromStyleSheet(header), false,
embeddedContentLength); | 68 contentProvider, SDK.ResourceTreeFrame.fromStyleSheet(header), false,
embeddedContentLength); |
| 63 } | 69 } |
| 64 Bindings.cssWorkspaceBinding.updateLocations(header); | 70 Bindings.cssWorkspaceBinding.updateLocations(header); |
| 71 this._sourceMapAttachedForTest(sourceMap); |
| 65 } | 72 } |
| 66 | 73 |
| 67 /** | 74 /** |
| 68 * @param {!Common.Event} event | 75 * @param {!Common.Event} event |
| 69 */ | 76 */ |
| 70 _sourceMapDetached(event) { | 77 _sourceMapDetached(event) { |
| 71 var header = /** @type {!SDK.CSSStyleSheetHeader} */ (event.data); | 78 var header = /** @type {!SDK.CSSStyleSheetHeader} */ (event.data); |
| 72 Bindings.cssWorkspaceBinding.updateLocations(header); | 79 Bindings.cssWorkspaceBinding.updateLocations(header); |
| 73 } | 80 } |
| 74 | 81 |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 114 var uiSourceCode = Bindings.NetworkProject.uiSourceCodeForStyleURL(this._wor
kspace, entry.sourceURL, header); | 121 var uiSourceCode = Bindings.NetworkProject.uiSourceCodeForStyleURL(this._wor
kspace, entry.sourceURL, header); |
| 115 if (!uiSourceCode) | 122 if (!uiSourceCode) |
| 116 return null; | 123 return null; |
| 117 return uiSourceCode.uiLocation(entry.sourceLineNumber || 0, entry.sourceColu
mnNumber); | 124 return uiSourceCode.uiLocation(entry.sourceLineNumber || 0, entry.sourceColu
mnNumber); |
| 118 } | 125 } |
| 119 | 126 |
| 120 dispose() { | 127 dispose() { |
| 121 Common.EventTarget.removeEventListeners(this._eventListeners); | 128 Common.EventTarget.removeEventListeners(this._eventListeners); |
| 122 } | 129 } |
| 123 }; | 130 }; |
| OLD | NEW |