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

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

Issue 2857453002: DevTools: support resolving a UILocation to multiple raw script locations (Closed)
Patch Set: Created 3 years, 7 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 132 matching lines...) Expand 10 before | Expand all | Expand 10 after
143 return null; 143 return null;
144 return uiSourceCode.uiLocation( 144 return uiSourceCode.uiLocation(
145 /** @type {number} */ (entry.sourceLineNumber), /** @type {number} */ (e ntry.sourceColumnNumber)); 145 /** @type {number} */ (entry.sourceLineNumber), /** @type {number} */ (e ntry.sourceColumnNumber));
146 } 146 }
147 147
148 /** 148 /**
149 * @override 149 * @override
150 * @param {!Workspace.UISourceCode} uiSourceCode 150 * @param {!Workspace.UISourceCode} uiSourceCode
151 * @param {number} lineNumber 151 * @param {number} lineNumber
152 * @param {number} columnNumber 152 * @param {number} columnNumber
153 * @return {?SDK.DebuggerModel.Location} 153 * @return {!Array<!SDK.DebuggerModel.Location>}
154 */ 154 */
155 uiLocationToRawLocation(uiSourceCode, lineNumber, columnNumber) { 155 uiLocationToRawLocations(uiSourceCode, lineNumber, columnNumber) {
156 var script = uiSourceCode[Bindings.CompilerScriptMapping._scriptSymbol]; 156 var script = uiSourceCode[Bindings.CompilerScriptMapping._scriptSymbol];
157 if (!script) 157 if (!script)
158 return null; 158 return [];
159 var sourceMap = this._sourceMapManager.sourceMapForClient(script); 159 var sourceMap = this._sourceMapManager.sourceMapForClient(script);
160 if (!sourceMap) 160 if (!sourceMap)
161 return null; 161 return [];
162 var entry = sourceMap.firstSourceLineMapping(uiSourceCode.url(), lineNumber) ; 162 var entry = sourceMap.firstSourceLineMapping(uiSourceCode.url(), lineNumber) ;
dgozman 2017/05/02 19:47:41 We can actually return multiple here. Are you goin
163 if (!entry) 163 if (!entry)
164 return null; 164 return [];
165 return this._debuggerModel.createRawLocation(script, entry.lineNumber, entry .columnNumber); 165 var location = this._debuggerModel.createRawLocation(script, entry.lineNumbe r, entry.columnNumber);
166 return location ? [location] : [];
166 } 167 }
167 168
168 /** 169 /**
169 * @param {!Common.Event} event 170 * @param {!Common.Event} event
170 */ 171 */
171 _sourceMapWillAttach(event) { 172 _sourceMapWillAttach(event) {
172 var script = /** @type {!SDK.Script} */ (event.data); 173 var script = /** @type {!SDK.Script} */ (event.data);
173 // Create stub UISourceCode for the time source mapping is being loaded. 174 // Create stub UISourceCode for the time source mapping is being loaded.
174 this._addStubUISourceCode(script); 175 this._addStubUISourceCode(script);
175 this._debuggerWorkspaceBinding.pushSourceMapping(script, this); 176 this._debuggerWorkspaceBinding.pushSourceMapping(script, this);
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
282 } 283 }
283 284
284 dispose() { 285 dispose() {
285 Common.EventTarget.removeEventListeners(this._eventListeners); 286 Common.EventTarget.removeEventListeners(this._eventListeners);
286 this._stubProject.dispose(); 287 this._stubProject.dispose();
287 } 288 }
288 }; 289 };
289 290
290 Bindings.CompilerScriptMapping._scriptSymbol = Symbol('Bindings.CompilerScriptMa pping._scriptSymbol'); 291 Bindings.CompilerScriptMapping._scriptSymbol = Symbol('Bindings.CompilerScriptMa pping._scriptSymbol');
291 Bindings.CompilerScriptMapping._frameIdSymbol = Symbol('Bindings.CompilerScriptM apping._frameIdSymbol'); 292 Bindings.CompilerScriptMapping._frameIdSymbol = Symbol('Bindings.CompilerScriptM apping._frameIdSymbol');
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698