Changeset 116217 in webkit
- Timestamp:
- May 5, 2012 3:07:39 AM (12 years ago)
- Location:
- trunk
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r116214 r116217 1 2012-05-05 Pavel Feldman <pfeldman@chromium.org> 2 3 Web Inspector: allow overriding the script mapping on the UI level 4 https://bugs.webkit.org/show_bug.cgi?id=85702 5 6 Reviewed by Yury Semikhatsky. 7 8 * inspector/debugger/breakpoint-manager.html: 9 1 10 2012-05-05 Zan Dobersek <zandobersek@gmail.com> 2 11 -
trunk/LayoutTests/inspector/debugger/breakpoint-manager.html
r115961 r116217 10 10 rawLocationToUILocation: function(rawLocation) 11 11 { 12 var uiSourceCode = {}; 13 uiSourceCode.id = rawLocation.scriptId; 12 var uiSourceCode = new WebInspector.UISourceCode(rawLocation.scriptId, rawLocation.scriptId, null); 14 13 return new WebInspector.UILocation(uiSourceCode, rawLocation.lineNumber, 0); 15 14 }, … … 24 23 rawLocationToUILocation: function(rawLocation) 25 24 { 26 var uiSourceCode = {}; 27 uiSourceCode.id = rawLocation.scriptId; 25 var uiSourceCode = new WebInspector.UISourceCode(rawLocation.scriptId, rawLocation.scriptId, null); 28 26 return new WebInspector.UILocation(uiSourceCode, rawLocation.lineNumber + 10, 0); 29 27 }, -
trunk/Source/WebCore/ChangeLog
r116216 r116217 1 2012-05-05 Pavel Feldman <pfeldman@chromium.org> 2 3 Web Inspector: allow overriding the script mapping on the UI level 4 https://bugs.webkit.org/show_bug.cgi?id=85702 5 6 Reviewed by Yury Semikhatsky. 7 8 This allows formatting update live locations all over the place automatically. 9 10 * inspector/front-end/Script.js: 11 (WebInspector.Script.prototype.rawLocationToUILocation): 12 (WebInspector.Script.Location): 13 (WebInspector.Script.Location.prototype.update): 14 (WebInspector.Script.Location.prototype.dispose): 15 * inspector/front-end/UISourceCode.js: 16 (WebInspector.UISourceCode): 17 (WebInspector.UISourceCode.prototype.addLiveLocation): 18 (WebInspector.UISourceCode.prototype.removeLiveLocation): 19 (WebInspector.UISourceCode.prototype.updateLiveLocations): 20 (WebInspector.UISourceCode.prototype.overrideLocation): 21 1 22 2012-05-05 Pavel Feldman <pfeldman@chromium.org> 2 23 -
trunk/Source/WebCore/inspector/front-end/Script.js
r115979 r116217 157 157 { 158 158 console.assert(rawLocation.scriptId === this.scriptId); 159 return this._sourceMapping.rawLocationToUILocation(rawLocation); 159 var uiLocation = this._sourceMapping.rawLocationToUILocation(rawLocation); 160 // FIXME: uiLocation will never be null after the next refactoring step. 161 return uiLocation ? uiLocation.uiSourceCode.overrideLocation(uiLocation) : null; 160 162 }, 161 163 … … 197 199 this._rawLocation = rawLocation; 198 200 this._updateDelegate = updateDelegate; 201 this._uiSourceCodes = []; 199 202 } 200 203 201 204 WebInspector.Script.Location.prototype = { 202 dispose: function()203 {204 this._script._locations.remove(this);205 },206 207 205 update: function() 208 206 { 209 if (!this._script._sourceMapping) 210 return; 211 var uiLocation = this._script._sourceMapping.rawLocationToUILocation(this._rawLocation); 207 var uiLocation = this._script.rawLocationToUILocation(this._rawLocation); 212 208 if (uiLocation) { 209 var uiSourceCode = uiLocation.uiSourceCode; 210 if (this._uiSourceCodes.indexOf(uiSourceCode) === -1) { 211 uiSourceCode.addLiveLocation(this); 212 this._uiSourceCodes.push(uiSourceCode); 213 } 213 214 var oneTime = this._updateDelegate(uiLocation); 214 215 if (oneTime) 215 216 this.dispose(); 216 217 } 218 }, 219 220 dispose: function() 221 { 222 for (var i = 0; i < this._uiSourceCodes.length; ++i) 223 this._uiSourceCodes[i].removeLiveLocation(this); 224 this._uiSourceCodes = []; 225 this._script._locations.remove(this); 217 226 } 218 227 } -
trunk/Source/WebCore/inspector/front-end/UISourceCode.js
r115961 r116217 49 49 */ 50 50 this._requestContentCallbacks = []; 51 this._liveLocations = []; 51 52 } 52 53 … … 136 137 137 138 /** 139 * @param {WebInspector.LiveLocation} liveLocation 140 */ 141 addLiveLocation: function(liveLocation) 142 { 143 this._liveLocations.push(liveLocation); 144 }, 145 146 /** 147 * @param {WebInspector.LiveLocation} liveLocation 148 */ 149 removeLiveLocation: function(liveLocation) 150 { 151 this._liveLocations.remove(liveLocation); 152 }, 153 154 updateLiveLocations: function() 155 { 156 var locationsCopy = this._liveLocations.slice(); 157 for (var i = 0; i < locationsCopy.length; ++i) 158 locationsCopy[i].update(); 159 }, 160 161 /** 162 * @param {WebInspector.UILocation} uiLocation 163 * @return {WebInspector.UILocation} 164 */ 165 overrideLocation: function(uiLocation) 166 { 167 return uiLocation; 168 }, 169 170 /** 138 171 * @return {Array.<WebInspector.PresentationConsoleMessage>} 139 172 */
Note: See TracChangeset
for help on using the changeset viewer.