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

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

Issue 2869293002: DevTools: make CompilerScriptMapping / SASSSourceMapping manage UISourceCodes (Closed)
Patch Set: address comments 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 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 * @unrestricted 5 * @unrestricted
6 * @implements {SDK.SDKModelObserver<!SDK.DebuggerModel>} 6 * @implements {SDK.SDKModelObserver<!SDK.DebuggerModel>}
7 */ 7 */
8 Bindings.DebuggerWorkspaceBinding = class extends Common.Object { 8 Bindings.DebuggerWorkspaceBinding = class extends Common.Object {
9 /** 9 /**
10 * @param {!SDK.TargetManager} targetManager 10 * @param {!SDK.TargetManager} targetManager
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after
160 * @param {!SDK.DebuggerModel.Location} rawLocation 160 * @param {!SDK.DebuggerModel.Location} rawLocation
161 * @return {!Workspace.UILocation} 161 * @return {!Workspace.UILocation}
162 */ 162 */
163 rawLocationToUILocation(rawLocation) { 163 rawLocationToUILocation(rawLocation) {
164 var info = this._infoForScript(rawLocation.script()); 164 var info = this._infoForScript(rawLocation.script());
165 console.assert(info); 165 console.assert(info);
166 return info._rawLocationToUILocation(rawLocation); 166 return info._rawLocationToUILocation(rawLocation);
167 } 167 }
168 168
169 /** 169 /**
170 * @param {!SDK.DebuggerModel} debuggerModel
171 * @param {string} url
172 * @param {boolean} isContentScript
173 */
174 uiSourceCodeForSourceMapSourceURL(debuggerModel, url, isContentScript) {
175 var modelData = this._debuggerModelToData.get(debuggerModel);
176 if (!modelData)
177 return null;
178 return modelData._compilerMapping.uiSourceCodeForURL(url, isContentScript);
179 }
180
181 /**
170 * @param {!Workspace.UISourceCode} uiSourceCode 182 * @param {!Workspace.UISourceCode} uiSourceCode
171 * @param {number} lineNumber 183 * @param {number} lineNumber
172 * @param {number} columnNumber 184 * @param {number} columnNumber
173 * @return {?SDK.DebuggerModel.Location} 185 * @return {?SDK.DebuggerModel.Location}
174 */ 186 */
175 uiLocationToRawLocation(uiSourceCode, lineNumber, columnNumber) { 187 uiLocationToRawLocation(uiSourceCode, lineNumber, columnNumber) {
176 var sourceMapping = uiSourceCode[Bindings.DebuggerWorkspaceBinding._sourceMa ppingSymbol]; 188 var sourceMapping = uiSourceCode[Bindings.DebuggerWorkspaceBinding._sourceMa ppingSymbol];
177 return sourceMapping && sourceMapping.uiLocationToRawLocation(uiSourceCode, lineNumber, columnNumber); 189 return sourceMapping && sourceMapping.uiLocationToRawLocation(uiSourceCode, lineNumber, columnNumber);
178 } 190 }
179 191
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
319 this._debuggerModel = debuggerModel; 331 this._debuggerModel = debuggerModel;
320 this._debuggerWorkspaceBinding = debuggerWorkspaceBinding; 332 this._debuggerWorkspaceBinding = debuggerWorkspaceBinding;
321 333
322 /** @type {!Set.<!Bindings.DebuggerWorkspaceBinding.Location>} */ 334 /** @type {!Set.<!Bindings.DebuggerWorkspaceBinding.Location>} */
323 this.callFrameLocations = new Set(); 335 this.callFrameLocations = new Set();
324 336
325 var workspace = debuggerWorkspaceBinding._workspace; 337 var workspace = debuggerWorkspaceBinding._workspace;
326 338
327 this._defaultMapping = new Bindings.DefaultScriptMapping(debuggerModel, work space, debuggerWorkspaceBinding); 339 this._defaultMapping = new Bindings.DefaultScriptMapping(debuggerModel, work space, debuggerWorkspaceBinding);
328 this._resourceMapping = new Bindings.ResourceScriptMapping(debuggerModel, wo rkspace, debuggerWorkspaceBinding); 340 this._resourceMapping = new Bindings.ResourceScriptMapping(debuggerModel, wo rkspace, debuggerWorkspaceBinding);
329 this._compilerMapping = new Bindings.CompilerScriptMapping( 341 this._compilerMapping = new Bindings.CompilerScriptMapping(debuggerModel, wo rkspace, debuggerWorkspaceBinding);
330 debuggerModel, workspace, Bindings.NetworkProject.forTarget(this._debugg erModel.target()),
331 debuggerWorkspaceBinding);
332 342
333 debuggerModel.setBeforePausedCallback(this._beforePaused.bind(this)); 343 debuggerModel.setBeforePausedCallback(this._beforePaused.bind(this));
334 this._eventListeners = [ 344 this._eventListeners = [
335 debuggerModel.addEventListener(SDK.DebuggerModel.Events.ParsedScriptSource , this._parsedScriptSource, this), 345 debuggerModel.addEventListener(SDK.DebuggerModel.Events.ParsedScriptSource , this._parsedScriptSource, this),
336 debuggerModel.addEventListener( 346 debuggerModel.addEventListener(
337 SDK.DebuggerModel.Events.FailedToParseScriptSource, this._parsedScript Source, this), 347 SDK.DebuggerModel.Events.FailedToParseScriptSource, this._parsedScript Source, this),
338 debuggerModel.addEventListener( 348 debuggerModel.addEventListener(
339 SDK.DebuggerModel.Events.DiscardedAnonymousScriptSource, this._discard edScriptSource, this) 349 SDK.DebuggerModel.Events.DiscardedAnonymousScriptSource, this._discard edScriptSource, this)
340 ]; 350 ];
341 } 351 }
(...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after
600 * @param {number} lineNumber 610 * @param {number} lineNumber
601 * @return {boolean} 611 * @return {boolean}
602 */ 612 */
603 uiLineHasMapping(uiSourceCode, lineNumber) {} 613 uiLineHasMapping(uiSourceCode, lineNumber) {}
604 }; 614 };
605 615
606 /** 616 /**
607 * @type {!Bindings.DebuggerWorkspaceBinding} 617 * @type {!Bindings.DebuggerWorkspaceBinding}
608 */ 618 */
609 Bindings.debuggerWorkspaceBinding; 619 Bindings.debuggerWorkspaceBinding;
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698