Title: [89135] trunk/Source/WebCore
- Revision
- 89135
- Author
- podivi...@chromium.org
- Date
- 2011-06-17 05:40:35 -0700 (Fri, 17 Jun 2011)
Log Message
2011-06-16 Pavel Podivilov <podivi...@chromium.org>
Reviewed by Yury Semikhatsky.
Web Inspector: breakpointsWithoutSourceFile values should be a maps, not arrays.
https://bugs.webkit.org/show_bug.cgi?id=62714
* inspector/front-end/DebuggerPresentationModel.js:
(WebInspector.DebuggerPresentationModel.prototype._restoreBreakpoints):
(WebInspector.DebuggerPresentationModel.prototype.setFormatSourceFiles):
(WebInspector.DebuggerPresentationModel.prototype._restoreBreakpointsFromSettings):
(WebInspector.DebuggerPresentationModel.prototype._saveBreakpoints):
(WebInspector.DebuggerPresentationModel.prototype._reset):
* inspector/front-end/Settings.js:
(WebInspector.Settings):
(WebInspector.Settings.prototype._set):
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (89134 => 89135)
--- trunk/Source/WebCore/ChangeLog 2011-06-17 12:10:40 UTC (rev 89134)
+++ trunk/Source/WebCore/ChangeLog 2011-06-17 12:40:35 UTC (rev 89135)
@@ -1,3 +1,20 @@
+2011-06-16 Pavel Podivilov <podivi...@chromium.org>
+
+ Reviewed by Yury Semikhatsky.
+
+ Web Inspector: breakpointsWithoutSourceFile values should be a maps, not arrays.
+ https://bugs.webkit.org/show_bug.cgi?id=62714
+
+ * inspector/front-end/DebuggerPresentationModel.js:
+ (WebInspector.DebuggerPresentationModel.prototype._restoreBreakpoints):
+ (WebInspector.DebuggerPresentationModel.prototype.setFormatSourceFiles):
+ (WebInspector.DebuggerPresentationModel.prototype._restoreBreakpointsFromSettings):
+ (WebInspector.DebuggerPresentationModel.prototype._saveBreakpoints):
+ (WebInspector.DebuggerPresentationModel.prototype._reset):
+ * inspector/front-end/Settings.js:
+ (WebInspector.Settings):
+ (WebInspector.Settings.prototype._set):
+
2011-06-17 Joone Hur <joone....@collabora.co.uk>
Reviewed by Martin Robinson.
Modified: trunk/Source/WebCore/inspector/front-end/DebuggerPresentationModel.js (89134 => 89135)
--- trunk/Source/WebCore/inspector/front-end/DebuggerPresentationModel.js 2011-06-17 12:10:40 UTC (rev 89134)
+++ trunk/Source/WebCore/inspector/front-end/DebuggerPresentationModel.js 2011-06-17 12:40:35 UTC (rev 89135)
@@ -159,8 +159,10 @@
_restoreBreakpoints: function(sourceFile)
{
var pendingBreakpoints = this._breakpointsWithoutSourceFile[sourceFile.id];
- for (var i = 0; pendingBreakpoints && i < pendingBreakpoints.length; ++i) {
- var breakpointData = pendingBreakpoints[i];
+ if (!pendingBreakpoints)
+ return;
+ for (var lineNumber in pendingBreakpoints) {
+ var breakpointData = pendingBreakpoints[lineNumber];
if ("debuggerId" in breakpointData) {
var breakpoint = new WebInspector.PresentationBreakpoint(sourceFile, breakpointData.lineNumber, breakpointData.condition, breakpointData.enabled);
this._bindDebuggerId(breakpoint, breakpointData.debuggerId);
@@ -253,8 +255,8 @@
for (var id in this._breakpointsWithoutSourceFile) {
var breakpoints = this._breakpointsWithoutSourceFile[id];
- for (var i = 0; i < breakpoints.length; ++i)
- this._removeBreakpointFromDebugger(breakpoints[i]);
+ for (var lineNumber in breakpoints)
+ this._removeBreakpointFromDebugger(breakpoints[lineNumber]);
}
var messages = this._messages;
@@ -521,10 +523,10 @@
// Add breakpoint once source file becomes available.
var pendingBreakpoints = this._breakpointsWithoutSourceFile[sourceFileId];
if (!pendingBreakpoints) {
- pendingBreakpoints = [];
+ pendingBreakpoints = {};
this._breakpointsWithoutSourceFile[sourceFileId] = pendingBreakpoints;
}
- pendingBreakpoints.push(breakpointData);
+ pendingBreakpoints[breakpointData.lineNumber] = breakpointData;
}
},
@@ -543,8 +545,11 @@
}
// Store not added breakpoints.
- for (var sourceFileId in this._breakpointsWithoutSourceFile)
- serializedBreakpoints = serializedBreakpoints.concat(this._breakpointsWithoutSourceFile[sourceFileId]);
+ for (var sourceFileId in this._breakpointsWithoutSourceFile) {
+ var breakpoints = this._breakpointsWithoutSourceFile[sourceFileId];
+ for (var lineNumber in breakpoints)
+ serializedBreakpoints.push(breakpoints[lineNumber]);
+ }
// Sanitize debugger ids.
for (var i = 0; i < serializedBreakpoints.length; ++i) {
@@ -624,10 +629,10 @@
for (var line in sourceFile.breakpoints) {
var breakpoints = this._breakpointsWithoutSourceFile[sourceFile.id];
if (!breakpoints) {
- breakpoints = [];
+ breakpoints = {};
this._breakpointsWithoutSourceFile[sourceFile.id] = breakpoints;
}
- breakpoints.push(sourceFile.breakpoints[line].serialize());
+ breakpoints[line] = sourceFile.breakpoints[line].serialize();
}
}
Modified: trunk/Source/WebCore/inspector/front-end/Settings.js (89134 => 89135)
--- trunk/Source/WebCore/inspector/front-end/Settings.js 2011-06-17 12:10:40 UTC (rev 89134)
+++ trunk/Source/WebCore/inspector/front-end/Settings.js 2011-06-17 12:40:35 UTC (rev 89135)
@@ -79,11 +79,12 @@
this.installApplicationSetting("domBreakpoints", []);
this.installApplicationSetting("xhrBreakpoints", []);
- this._migrateSettings();
+ // If there are too many breakpoints in a storage, it is likely due to a recent bug that caused
+ // periodical breakpoints duplication leading to inspector slowness.
+ if (window.localStorage.breakpoints && window.localStorage.breakpoints.length > 500000)
+ delete window.localStorage.breakpoints;
}
-WebInspector.Settings.version = "1";
-
WebInspector.Settings.prototype = {
installApplicationSetting: function(key, defaultValue)
{
@@ -110,21 +111,6 @@
{
if (window.localStorage != null)
window.localStorage[key] = JSON.stringify(value);
- },
-
- _migrateSettings: function()
- {
- if (!window.localStorage)
- return;
- var version = localStorage.version;
- if (version === WebInspector.Settings.version)
- return;
-
- var breakpointKeys = ["breakpoints", "eventListenerBreakpoints", "domBreakpoints", "xhrBreakpoints"];
- for (var i = 0; i < breakpointKeys.length; i++)
- delete localStorage[breakpointKeys[i]];
-
- localStorage.version = WebInspector.Settings.version;
}
}
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes