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

Side by Side Diff: Source/devtools/front_end/sdk/CompilerScriptMapping.js

Issue 373743003: DevTools: Add support for adding source map to a script from the DevTools window. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebaselined Created 6 years, 5 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 | Annotate | Revision Log
« no previous file with comments | « Source/devtools/devtools.gypi ('k') | Source/devtools/front_end/sdk/ResourceScriptMapping.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
100 return null; 100 return null;
101 return this._debuggerModel.createRawLocation(script, /** @type {number} */ (entry[0]), /** @type {number} */ (entry[1])); 101 return this._debuggerModel.createRawLocation(script, /** @type {number} */ (entry[0]), /** @type {number} */ (entry[1]));
102 }, 102 },
103 103
104 /** 104 /**
105 * @param {!WebInspector.Script} script 105 * @param {!WebInspector.Script} script
106 */ 106 */
107 addScript: function(script) 107 addScript: function(script)
108 { 108 {
109 script.pushSourceMapping(this); 109 script.pushSourceMapping(this);
110 script.addEventListener(WebInspector.Script.Events.SourceMapURLAdded, th is._sourceMapURLAdded.bind(this));
111 this._processScript(script);
112 },
113
114 /**
115 * @param {!WebInspector.Event} event
116 */
117 _sourceMapURLAdded: function(event)
118 {
119 var script = /** @type {!WebInspector.Script} */ (event.target);
120 this._processScript(script);
121 },
122
123 /**
124 * @param {!WebInspector.Script} script
125 */
126 _processScript: function(script)
127 {
110 this.loadSourceMapForScript(script, sourceMapLoaded.bind(this)); 128 this.loadSourceMapForScript(script, sourceMapLoaded.bind(this));
111 129
112 /** 130 /**
113 * @param {?WebInspector.SourceMap} sourceMap 131 * @param {?WebInspector.SourceMap} sourceMap
114 * @this {WebInspector.CompilerScriptMapping} 132 * @this {WebInspector.CompilerScriptMapping}
115 */ 133 */
116 function sourceMapLoaded(sourceMap) 134 function sourceMapLoaded(sourceMap)
117 { 135 {
118 if (!sourceMap) 136 if (!sourceMap)
119 return; 137 return;
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after
276 this._sourceMapForScriptId = {}; 294 this._sourceMapForScriptId = {};
277 this._scriptForSourceMap.clear(); 295 this._scriptForSourceMap.clear();
278 this._sourceMapForURL.clear(); 296 this._sourceMapForURL.clear();
279 }, 297 },
280 298
281 dispose: function() 299 dispose: function()
282 { 300 {
283 this._workspace.removeEventListener(WebInspector.Workspace.Events.UISour ceCodeAdded, this._uiSourceCodeAddedToWorkspace, this); 301 this._workspace.removeEventListener(WebInspector.Workspace.Events.UISour ceCodeAdded, this._uiSourceCodeAddedToWorkspace, this);
284 } 302 }
285 } 303 }
OLDNEW
« no previous file with comments | « Source/devtools/devtools.gypi ('k') | Source/devtools/front_end/sdk/ResourceScriptMapping.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698