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

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/bindings/CompilerScriptMapping.js

Issue 1583383003: [DevTools] Send source map content from frontend to backend (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@blackbox-inline-source-map
Patch Set: Created 4 years, 11 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
OLDNEW
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 309 matching lines...) Expand 10 before | Expand all | Expand 10 after
320 320
321 var pendingCallbacks = this._pendingSourceMapLoadingCallbacks[sourceMapU RL]; 321 var pendingCallbacks = this._pendingSourceMapLoadingCallbacks[sourceMapU RL];
322 if (pendingCallbacks) { 322 if (pendingCallbacks) {
323 pendingCallbacks.push(callback); 323 pendingCallbacks.push(callback);
324 return; 324 return;
325 } 325 }
326 326
327 pendingCallbacks = [callback]; 327 pendingCallbacks = [callback];
328 this._pendingSourceMapLoadingCallbacks[sourceMapURL] = pendingCallbacks; 328 this._pendingSourceMapLoadingCallbacks[sourceMapURL] = pendingCallbacks;
329 329
330 WebInspector.SourceMap.load(sourceMapURL, scriptURL, sourceMapLoaded.bin d(this)); 330 WebInspector.SourceMap.load(sourceMapURL, scriptURL, sourceMapLoaded.bin d(this), sourceMapContentLoaded.bind(this));
331 331
332 /** 332 /**
333 * @param {?WebInspector.SourceMap} sourceMap 333 * @param {?WebInspector.SourceMap} sourceMap
334 * @this {WebInspector.CompilerScriptMapping} 334 * @this {WebInspector.CompilerScriptMapping}
335 */ 335 */
336 function sourceMapLoaded(sourceMap) 336 function sourceMapLoaded(sourceMap)
337 { 337 {
338 var url = /** @type {string} */ (sourceMapURL); 338 var url = /** @type {string} */ (sourceMapURL);
339 var callbacks = this._pendingSourceMapLoadingCallbacks[url]; 339 var callbacks = this._pendingSourceMapLoadingCallbacks[url];
340 delete this._pendingSourceMapLoadingCallbacks[url]; 340 delete this._pendingSourceMapLoadingCallbacks[url];
341 if (!callbacks) 341 if (!callbacks)
342 return; 342 return;
343 if (sourceMap) 343 if (sourceMap)
344 this._sourceMapForSourceMapURL[url] = sourceMap; 344 this._sourceMapForSourceMapURL[url] = sourceMap;
345 for (var i = 0; i < callbacks.length; ++i) 345 for (var i = 0; i < callbacks.length; ++i)
346 callbacks[i](sourceMap); 346 callbacks[i](sourceMap);
347 } 347 }
348
349 /**
350 * @param {string} content
351 * @this {WebInspector.CompilerScriptMapping}
352 */
353 function sourceMapContentLoaded(content)
354 {
355 this._debuggerModel.setSourceMapContent(script.scriptId, content);
356 }
348 }, 357 },
349 358
350 _debuggerReset: function() 359 _debuggerReset: function()
351 { 360 {
352 /** 361 /**
353 * @param {!WebInspector.SourceMap} sourceMap 362 * @param {!WebInspector.SourceMap} sourceMap
354 * @this {WebInspector.CompilerScriptMapping} 363 * @this {WebInspector.CompilerScriptMapping}
355 */ 364 */
356 function unbindSourceMapSources(sourceMap) 365 function unbindSourceMapSources(sourceMap)
357 { 366 {
(...skipping 15 matching lines...) Expand all
373 this._sourceMapForScriptId = {}; 382 this._sourceMapForScriptId = {};
374 this._scriptForSourceMap.clear(); 383 this._scriptForSourceMap.clear();
375 this._sourceMapForURL.clear(); 384 this._sourceMapForURL.clear();
376 }, 385 },
377 386
378 dispose: function() 387 dispose: function()
379 { 388 {
380 this._workspace.removeEventListener(WebInspector.Workspace.Events.UISour ceCodeAdded, this._uiSourceCodeAddedToWorkspace, this); 389 this._workspace.removeEventListener(WebInspector.Workspace.Events.UISour ceCodeAdded, this._uiSourceCodeAddedToWorkspace, this);
381 } 390 }
382 } 391 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698