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

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

Issue 2859073002: Revert of 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 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
77 if (script.isInlineScriptWithSourceURL() && !lineNumber && columnNumber) 77 if (script.isInlineScriptWithSourceURL() && !lineNumber && columnNumber)
78 columnNumber -= script.columnOffset; 78 columnNumber -= script.columnOffset;
79 return uiSourceCode.uiLocation(lineNumber, columnNumber); 79 return uiSourceCode.uiLocation(lineNumber, columnNumber);
80 } 80 }
81 81
82 /** 82 /**
83 * @override 83 * @override
84 * @param {!Workspace.UISourceCode} uiSourceCode 84 * @param {!Workspace.UISourceCode} uiSourceCode
85 * @param {number} lineNumber 85 * @param {number} lineNumber
86 * @param {number} columnNumber 86 * @param {number} columnNumber
87 * @return {!Array<!SDK.DebuggerModel.Location>} 87 * @return {?SDK.DebuggerModel.Location}
88 */ 88 */
89 uiLocationToRawLocations(uiSourceCode, lineNumber, columnNumber) { 89 uiLocationToRawLocation(uiSourceCode, lineNumber, columnNumber) {
90 var script = uiSourceCode[Bindings.DefaultScriptMapping._scriptSymbol]; 90 var script = uiSourceCode[Bindings.DefaultScriptMapping._scriptSymbol];
91 var location;
92 if (script.isInlineScriptWithSourceURL()) { 91 if (script.isInlineScriptWithSourceURL()) {
93 location = this._debuggerModel.createRawLocation( 92 return this._debuggerModel.createRawLocation(
94 script, lineNumber + script.lineOffset, lineNumber ? columnNumber : co lumnNumber + script.columnOffset); 93 script, lineNumber + script.lineOffset, lineNumber ? columnNumber : co lumnNumber + script.columnOffset);
95 } else {
96 location = this._debuggerModel.createRawLocation(script, lineNumber, colum nNumber);
97 } 94 }
98 return location ? [location] : []; 95 return this._debuggerModel.createRawLocation(script, lineNumber, columnNumbe r);
99 } 96 }
100 97
101 /** 98 /**
102 * @param {!SDK.Script} script 99 * @param {!SDK.Script} script
103 */ 100 */
104 addScript(script) { 101 addScript(script) {
105 var name = Common.ParsedURL.extractName(script.sourceURL); 102 var name = Common.ParsedURL.extractName(script.sourceURL);
106 var url = 'debugger:///VM' + script.scriptId + (name ? ' ' + name : ''); 103 var url = 'debugger:///VM' + script.scriptId + (name ? ' ' + name : '');
107 104
108 var uiSourceCode = this._project.createUISourceCode(url, Common.resourceType s.Script); 105 var uiSourceCode = this._project.createUISourceCode(url, Common.resourceType s.Script);
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
150 147
151 dispose() { 148 dispose() {
152 Common.EventTarget.removeEventListeners(this._eventListeners); 149 Common.EventTarget.removeEventListeners(this._eventListeners);
153 this._debuggerReset(); 150 this._debuggerReset();
154 this._project.dispose(); 151 this._project.dispose();
155 } 152 }
156 }; 153 };
157 154
158 Bindings.DefaultScriptMapping._scriptSymbol = Symbol('symbol'); 155 Bindings.DefaultScriptMapping._scriptSymbol = Symbol('symbol');
159 Bindings.DefaultScriptMapping._uiSourceCodeSymbol = Symbol('uiSourceCodeSymbol') ; 156 Bindings.DefaultScriptMapping._uiSourceCodeSymbol = Symbol('uiSourceCodeSymbol') ;
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698