Changeset 142725 in webkit


Ignore:
Timestamp:
Feb 12, 2013 11:24:02 PM (11 years ago)
Author:
vsevik@chromium.org
Message:

Web Inspector: Introduce version controller to migrate settings versions.
https://bugs.webkit.org/show_bug.cgi?id=109553

Reviewed by Yury Semikhatsky.

Source/WebCore:

This patch introduces version controller that could be used to migrate inspector settings.

Test: inspector/version-controller.html

  • inspector/front-end/Settings.js:

(WebInspector.Settings):
(WebInspector.VersionController):
(WebInspector.VersionController.prototype.set _methodsToRunToUpdateVersion):
(WebInspector.VersionController.prototype._updateVersionFrom0To1):

  • inspector/front-end/inspector.js:

LayoutTests:

  • inspector/version-controller-expected.txt: Added.
  • inspector/version-controller.html: Added.
Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r142723 r142725  
     12013-02-12  Vsevolod Vlasov  <vsevik@chromium.org>
     2
     3        Web Inspector: Introduce version controller to migrate settings versions.
     4        https://bugs.webkit.org/show_bug.cgi?id=109553
     5
     6        Reviewed by Yury Semikhatsky.
     7
     8        * inspector/version-controller-expected.txt: Added.
     9        * inspector/version-controller.html: Added.
     10
    1112013-02-12  Filip Pizlo  <fpizlo@apple.com>
    212
  • trunk/LayoutTests/inspector/version-controller-expected.txt

    r142614 r142725  
    3232
    3333Running: testClearBreakpointsWhenTooMany
    34 Starting test with 0 breakpoints.
     34Starting test with 0 breakpoints and 500 allowed at max.
    3535Number of breakpoints left in the setting after the test: 0.
    3636
    37 Starting test with 1 breakpoints.
     37Starting test with 1 breakpoints and 500 allowed at max.
    3838Number of breakpoints left in the setting after the test: 1.
    3939
    40 Starting test with 2 breakpoints.
     40Starting test with 2 breakpoints and 500 allowed at max.
    4141Number of breakpoints left in the setting after the test: 2.
    4242
    43 Starting test with 499999 breakpoints.
    44 Number of breakpoints left in the setting after the test: 499999.
     43Starting test with 499 breakpoints and 500 allowed at max.
     44Number of breakpoints left in the setting after the test: 499.
    4545
    46 Starting test with 500000 breakpoints.
    47 Number of breakpoints left in the setting after the test: 500000.
     46Starting test with 500 breakpoints and 500 allowed at max.
     47Number of breakpoints left in the setting after the test: 500.
    4848
    49 Starting test with 500001 breakpoints.
     49Starting test with 501 breakpoints and 500 allowed at max.
    5050Number of breakpoints left in the setting after the test: 0.
    5151
    52 Starting test with 1000000 breakpoints.
     52Starting test with 1000 breakpoints and 500 allowed at max.
    5353Number of breakpoints left in the setting after the test: 0.
    5454
  • trunk/LayoutTests/inspector/version-controller.html

    r142614 r142725  
    5151        function testClearBreakpointsWhenTooMany(next)
    5252        {
    53             function runClearBreakpointsTest(breakpointsCount)
     53            function runClearBreakpointsTest(breakpointsCount, maxBreakpointsCount)
    5454            {
    55                 InspectorTest.addResult("Starting test with " + breakpointsCount + " breakpoints.");
     55                InspectorTest.addResult("Starting test with " + breakpointsCount + " breakpoints and " + maxBreakpointsCount + " allowed at max.");
    5656                var versionController = new WebInspector.VersionController();
    5757                var serializedBreakpoints = [];
     
    5959                    serializedBreakpoints.push(createBreakpoint("file" + i + ".js", i % 10, "", true));
    6060                var breakpointsSetting = new MockSetting(serializedBreakpoints);
    61                 versionController._clearBreakpointsWhenTooMany(breakpointsSetting);
     61                versionController._clearBreakpointsWhenTooMany(breakpointsSetting, maxBreakpointsCount);
    6262                InspectorTest.addResult("Number of breakpoints left in the setting after the test: " + breakpointsSetting.get().length + ".");
    6363                InspectorTest.addResult("");
    6464            }
    6565
    66             runClearBreakpointsTest(0);
    67             runClearBreakpointsTest(1);
    68             runClearBreakpointsTest(2);
    69             runClearBreakpointsTest(499999);
    70             runClearBreakpointsTest(500000);
    71             runClearBreakpointsTest(500001);
    72             runClearBreakpointsTest(1000000);
     66            runClearBreakpointsTest(0, 500);
     67            runClearBreakpointsTest(1, 500);
     68            runClearBreakpointsTest(2, 500);
     69            runClearBreakpointsTest(499, 500);
     70            runClearBreakpointsTest(500, 500);
     71            runClearBreakpointsTest(501, 500);
     72            runClearBreakpointsTest(1000, 500);
    7373            next();
    7474        }
  • trunk/Source/WebCore/ChangeLog

    r142724 r142725  
     12013-02-12  Vsevolod Vlasov  <vsevik@chromium.org>
     2
     3        Web Inspector: Introduce version controller to migrate settings versions.
     4        https://bugs.webkit.org/show_bug.cgi?id=109553
     5
     6        Reviewed by Yury Semikhatsky.
     7
     8        This patch introduces version controller that could be used to migrate inspector settings.
     9
     10        Test: inspector/version-controller.html
     11
     12        * inspector/front-end/Settings.js:
     13        (WebInspector.Settings):
     14        (WebInspector.VersionController):
     15        (WebInspector.VersionController.prototype.set _methodsToRunToUpdateVersion):
     16        (WebInspector.VersionController.prototype._updateVersionFrom0To1):
     17        * inspector/front-end/inspector.js:
     18
    1192013-02-12  Martin Robinson  <mrobinson@igalia.com>
    220
  • trunk/Source/WebCore/inspector/front-end/Settings.js

    r142614 r142725  
    382382    _updateVersionFrom0To1: function()
    383383    {
    384         this._clearBreakpointsWhenTooMany(WebInspector.settings.breakpoints);
     384        this._clearBreakpointsWhenTooMany(WebInspector.settings.breakpoints, 500000);
    385385    },
    386386
    387387    /**
    388388     * @param {WebInspector.Setting} breakpointsSetting
    389      */
    390     _clearBreakpointsWhenTooMany: function(breakpointsSetting)
     389     * @param {number} maxBreakpointsCount
     390     */
     391    _clearBreakpointsWhenTooMany: function(breakpointsSetting, maxBreakpointsCount)
    391392    {
    392393        // If there are too many breakpoints in a storage, it is likely due to a recent bug that caused
    393394        // periodical breakpoints duplication leading to inspector slowness.
    394         if (breakpointsSetting.get().length > 500000)
     395        if (breakpointsSetting.get().length > maxBreakpointsCount)
    395396            breakpointsSetting.set([]);
    396397    }
Note: See TracChangeset for help on using the changeset viewer.