Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(176)

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/sdk/SourceMapManager.js

Issue 2779703004: DevTools: carefully cleanup CSS sourcemaps (Closed)
Patch Set: fix tests Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « third_party/WebKit/Source/devtools/front_end/bindings/SASSSourceMapping.js ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 /** 5 /**
6 * @template T 6 * @template T
7 */ 7 */
8 SDK.SourceMapManager = class extends SDK.SDKObject { 8 SDK.SourceMapManager = class extends SDK.SDKObject {
9 /** 9 /**
10 * @param {!SDK.Target} target 10 * @param {!SDK.Target} target
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after
177 attach.call(this, sourceMapURL, client); 177 attach.call(this, sourceMapURL, client);
178 } 178 }
179 179
180 /** 180 /**
181 * @param {string} sourceMapURL 181 * @param {string} sourceMapURL
182 * @param {!T} client 182 * @param {!T} client
183 * @this {SDK.SourceMapManager} 183 * @this {SDK.SourceMapManager}
184 */ 184 */
185 function attach(sourceMapURL, client) { 185 function attach(sourceMapURL, client) {
186 this._sourceMapURLToClients.set(sourceMapURL, client); 186 this._sourceMapURLToClients.set(sourceMapURL, client);
187 this.dispatchEventToListeners(SDK.SourceMapManager.Events.SourceMapAttache d, client); 187 var sourceMap = this._sourceMapByURL.get(sourceMapURL);
188 this.dispatchEventToListeners(
189 SDK.SourceMapManager.Events.SourceMapAttached, {client: client, source Map: sourceMap});
188 } 190 }
189 } 191 }
190 192
191 /** 193 /**
192 * @param {!SDK.SourceMap} sourceMap 194 * @param {!SDK.SourceMap} sourceMap
193 * @return {?Runtime.Extension} 195 * @return {?Runtime.Extension}
194 */ 196 */
195 _factoryForSourceMap(sourceMap) { 197 _factoryForSourceMap(sourceMap) {
196 var sourceExtensions = new Set(); 198 var sourceExtensions = new Set();
197 for (var url of sourceMap.sourceURLs()) 199 for (var url of sourceMap.sourceURLs())
(...skipping 15 matching lines...) Expand all
213 this._relativeSourceMapURL.delete(client); 215 this._relativeSourceMapURL.delete(client);
214 this._resolvedSourceMapURL.delete(client); 216 this._resolvedSourceMapURL.delete(client);
215 217
216 if (!sourceMapURL) 218 if (!sourceMapURL)
217 return; 219 return;
218 if (!this._sourceMapURLToClients.hasValue(sourceMapURL, client)) { 220 if (!this._sourceMapURLToClients.hasValue(sourceMapURL, client)) {
219 this._sourceMapURLToLoadingClients.remove(sourceMapURL, client); 221 this._sourceMapURLToLoadingClients.remove(sourceMapURL, client);
220 return; 222 return;
221 } 223 }
222 this._sourceMapURLToClients.remove(sourceMapURL, client); 224 this._sourceMapURLToClients.remove(sourceMapURL, client);
225 var sourceMap = this._sourceMapByURL.get(sourceMapURL);
223 if (!this._sourceMapURLToClients.has(sourceMapURL)) 226 if (!this._sourceMapURLToClients.has(sourceMapURL))
224 this._sourceMapByURL.delete(sourceMapURL); 227 this._sourceMapByURL.delete(sourceMapURL);
225 this.dispatchEventToListeners(SDK.SourceMapManager.Events.SourceMapDetached, client); 228 this.dispatchEventToListeners(
229 SDK.SourceMapManager.Events.SourceMapDetached, {client: client, sourceMa p: sourceMap});
226 } 230 }
227 231
228 _sourceMapLoadedForTest() { 232 _sourceMapLoadedForTest() {
229 } 233 }
230 234
231 dispose() { 235 dispose() {
232 SDK.targetManager.removeEventListener( 236 SDK.targetManager.removeEventListener(
233 SDK.TargetManager.Events.InspectedURLChanged, this._inspectedURLChanged, this); 237 SDK.TargetManager.Events.InspectedURLChanged, this._inspectedURLChanged, this);
234 } 238 }
235 }; 239 };
236 240
237 SDK.SourceMapManager.Events = { 241 SDK.SourceMapManager.Events = {
238 SourceMapAttached: Symbol('SourceMapAttached'), 242 SourceMapAttached: Symbol('SourceMapAttached'),
239 SourceMapDetached: Symbol('SourceMapDetached'), 243 SourceMapDetached: Symbol('SourceMapDetached'),
240 SourceMapChanged: Symbol('SourceMapChanged') 244 SourceMapChanged: Symbol('SourceMapChanged')
241 }; 245 };
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/devtools/front_end/bindings/SASSSourceMapping.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698