Changeset 89135 in webkit
- Timestamp:
- Jun 17, 2011 5:40:35 AM (13 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r89133 r89135 1 2011-06-16 Pavel Podivilov <podivilov@chromium.org> 2 3 Reviewed by Yury Semikhatsky. 4 5 Web Inspector: breakpointsWithoutSourceFile values should be a maps, not arrays. 6 https://bugs.webkit.org/show_bug.cgi?id=62714 7 8 * inspector/front-end/DebuggerPresentationModel.js: 9 (WebInspector.DebuggerPresentationModel.prototype._restoreBreakpoints): 10 (WebInspector.DebuggerPresentationModel.prototype.setFormatSourceFiles): 11 (WebInspector.DebuggerPresentationModel.prototype._restoreBreakpointsFromSettings): 12 (WebInspector.DebuggerPresentationModel.prototype._saveBreakpoints): 13 (WebInspector.DebuggerPresentationModel.prototype._reset): 14 * inspector/front-end/Settings.js: 15 (WebInspector.Settings): 16 (WebInspector.Settings.prototype._set): 17 1 18 2011-06-17 Joone Hur <joone.hur@collabora.co.uk> 2 19 -
trunk/Source/WebCore/inspector/front-end/DebuggerPresentationModel.js
r88927 r89135 160 160 { 161 161 var pendingBreakpoints = this._breakpointsWithoutSourceFile[sourceFile.id]; 162 for (var i = 0; pendingBreakpoints && i < pendingBreakpoints.length; ++i) { 163 var breakpointData = pendingBreakpoints[i]; 162 if (!pendingBreakpoints) 163 return; 164 for (var lineNumber in pendingBreakpoints) { 165 var breakpointData = pendingBreakpoints[lineNumber]; 164 166 if ("debuggerId" in breakpointData) { 165 167 var breakpoint = new WebInspector.PresentationBreakpoint(sourceFile, breakpointData.lineNumber, breakpointData.condition, breakpointData.enabled); … … 254 256 for (var id in this._breakpointsWithoutSourceFile) { 255 257 var breakpoints = this._breakpointsWithoutSourceFile[id]; 256 for (var i = 0; i < breakpoints.length; ++i)257 this._removeBreakpointFromDebugger(breakpoints[ i]);258 for (var lineNumber in breakpoints) 259 this._removeBreakpointFromDebugger(breakpoints[lineNumber]); 258 260 } 259 261 … … 522 524 var pendingBreakpoints = this._breakpointsWithoutSourceFile[sourceFileId]; 523 525 if (!pendingBreakpoints) { 524 pendingBreakpoints = [];526 pendingBreakpoints = {}; 525 527 this._breakpointsWithoutSourceFile[sourceFileId] = pendingBreakpoints; 526 528 } 527 pendingBreakpoints .push(breakpointData);529 pendingBreakpoints[breakpointData.lineNumber] = breakpointData; 528 530 } 529 531 }, … … 544 546 545 547 // Store not added breakpoints. 546 for (var sourceFileId in this._breakpointsWithoutSourceFile) 547 serializedBreakpoints = serializedBreakpoints.concat(this._breakpointsWithoutSourceFile[sourceFileId]); 548 for (var sourceFileId in this._breakpointsWithoutSourceFile) { 549 var breakpoints = this._breakpointsWithoutSourceFile[sourceFileId]; 550 for (var lineNumber in breakpoints) 551 serializedBreakpoints.push(breakpoints[lineNumber]); 552 } 548 553 549 554 // Sanitize debugger ids. … … 625 630 var breakpoints = this._breakpointsWithoutSourceFile[sourceFile.id]; 626 631 if (!breakpoints) { 627 breakpoints = [];632 breakpoints = {}; 628 633 this._breakpointsWithoutSourceFile[sourceFile.id] = breakpoints; 629 634 } 630 breakpoints .push(sourceFile.breakpoints[line].serialize());635 breakpoints[line] = sourceFile.breakpoints[line].serialize(); 631 636 } 632 637 } -
trunk/Source/WebCore/inspector/front-end/Settings.js
r88815 r89135 80 80 this.installApplicationSetting("xhrBreakpoints", []); 81 81 82 this._migrateSettings(); 82 // If there are too many breakpoints in a storage, it is likely due to a recent bug that caused 83 // periodical breakpoints duplication leading to inspector slowness. 84 if (window.localStorage.breakpoints && window.localStorage.breakpoints.length > 500000) 85 delete window.localStorage.breakpoints; 83 86 } 84 85 WebInspector.Settings.version = "1";86 87 87 88 WebInspector.Settings.prototype = { … … 111 112 if (window.localStorage != null) 112 113 window.localStorage[key] = JSON.stringify(value); 113 },114 115 _migrateSettings: function()116 {117 if (!window.localStorage)118 return;119 var version = localStorage.version;120 if (version === WebInspector.Settings.version)121 return;122 123 var breakpointKeys = ["breakpoints", "eventListenerBreakpoints", "domBreakpoints", "xhrBreakpoints"];124 for (var i = 0; i < breakpointKeys.length; i++)125 delete localStorage[breakpointKeys[i]];126 127 localStorage.version = WebInspector.Settings.version;128 114 } 129 115 }
Note: See TracChangeset
for help on using the changeset viewer.