Changeset 146983 in webkit


Ignore:
Timestamp:
Mar 27, 2013 7:37:43 AM (11 years ago)
Author:
vsevik@chromium.org
Message:

Web Inspector: Breakpoint manager should restore breakpoints when uiSourceCode is added.
https://bugs.webkit.org/show_bug.cgi?id=113381

Reviewed by Pavel Feldman.

Source/WebCore:

Breakpoint manager now restores breakpoints on UISourceCodeAdded event.
Breakpoint manager now only resets breakpoints in debugger when source mapping is changed to/from non identity one.

  • inspector/front-end/BreakpointManager.js:

(WebInspector.BreakpointManager.prototype._uiSourceCodeAdded):
(WebInspector.BreakpointManager.prototype._resetBreakpoints):
(WebInspector.BreakpointManager.prototype._uiSourceCodeMappingChanged):

  • inspector/front-end/CompilerScriptMapping.js:

(WebInspector.CompilerScriptMapping.prototype.get isIdentity):

  • inspector/front-end/DefaultScriptMapping.js:

(WebInspector.DefaultScriptMapping.prototype.isIdentity):

  • inspector/front-end/ResourceScriptMapping.js:

(WebInspector.ResourceScriptMapping.prototype.isIdentity):

  • inspector/front-end/SASSSourceMapping.js:

(WebInspector.SASSSourceMapping.prototype.isIdentity):

  • inspector/front-end/ScriptSnippetModel.js:

(WebInspector.SnippetScriptMapping.prototype.isIdentity):

  • inspector/front-end/SourceMapping.js:

(WebInspector.SourceMapping.prototype.isIdentity):

  • inspector/front-end/StylesSourceMapping.js:

(WebInspector.StylesSourceMapping.prototype.isIdentity):

  • inspector/front-end/UISourceCode.js:

(WebInspector.UISourceCode.prototype.setSourceMapping):

LayoutTests:

  • inspector/debugger/breakpoint-manager-expected.txt:
  • inspector/debugger/breakpoint-manager.html:
Location:
trunk
Files:
13 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r146980 r146983  
     12013-03-27  Vsevolod Vlasov  <vsevik@chromium.org>
     2
     3        Web Inspector: Breakpoint manager should restore breakpoints when uiSourceCode is added.
     4        https://bugs.webkit.org/show_bug.cgi?id=113381
     5
     6        Reviewed by Pavel Feldman.
     7
     8        * inspector/debugger/breakpoint-manager-expected.txt:
     9        * inspector/debugger/breakpoint-manager.html:
     10
    1112013-03-27  Sheriff Bot  <webkit.review.bot@gmail.com>
    212
  • trunk/LayoutTests/inspector/debugger/breakpoint-manager-expected.txt

    r146782 r146983  
    6969  Adding UISourceCode: a.js
    7070    debuggerModel.setBreakpoint(a.js:10:foo == bar)
    71     breakpointAdded(a.js, 10, foo == bar, true)
    72     Location created: a.js:10
    73     breakpointAdded(a.js, 20, , false)
     71    breakpointAdded(a.js, 20, , false)
     72    breakpointAdded(a.js, 10, foo == bar, true)
     73    Location created: a.js:10
    7474  Dumping Storage
    7575    a.js:10 enabled:true condition:foo == bar
     
    9090  Adding UISourceCode: a.js
    9191    debuggerModel.setBreakpoint(a.js:10:foo == bar)
    92     breakpointAdded(a.js, 10, foo == bar, true)
    93     Location created: a.js:10
    94     breakpointAdded(a.js, 20, , false)
    95   Adding UISourceCode: a.js
    96   Dumping Storage
    97     a.js:10 enabled:true condition:foo == bar
    98     a.js:20 enabled:false condition:
    99     b.js:3 enabled:true condition:
    100   Resetting breakpoint manager
    101     breakpointRemoved(a.js, 10)
    102     Location disposed: a.js:10
    103     debuggerModel.removeBreakpoint(a.js:10)
    104     breakpointRemoved(a.js, 20)
    105 
    106 Running: testRestoreBreakpointsAfterTemporaryUISourceCodeRemoved
    107   Created breakpoints manager
    108   Dumping Storage
    109     a.js:10 enabled:true condition:foo == bar
    110     a.js:20 enabled:false condition:
    111     b.js:3 enabled:true condition:
    112   Adding temporary UISourceCode: a.js
    113   Adding UISourceCode: a.js
    114     debuggerModel.setBreakpoint(a.js:10:foo == bar)
    115     breakpointAdded(a.js, 10, foo == bar, true)
    116     Location created: a.js:10
    117     breakpointAdded(a.js, 20, , false)
     92    breakpointAdded(a.js, 20, , false)
     93  Adding UISourceCode: a.js
     94    breakpointAdded(a.js, 10, foo == bar, true)
     95    Location created: a.js:10
    11896  Dumping Storage
    11997    a.js:10 enabled:true condition:foo == bar
     
    134112  Adding UISourceCode: a.js
    135113    debuggerModel.setBreakpoint(a.js:10:foo == bar)
    136     breakpointAdded(a.js, 10, foo == bar, true)
    137     Location created: a.js:10
    138     breakpointAdded(a.js, 20, , false)
     114    breakpointAdded(a.js, 20, , false)
     115    breakpointAdded(a.js, 10, foo == bar, true)
     116    Location created: a.js:10
    139117  Setting breakpoint at a.js:30 enabled:true condition:
    140118    debuggerModel.setBreakpoint(a.js:30:)
     
    206184  Adding UISourceCode: a.js
    207185    debuggerModel.setBreakpoint(a.js:10:foo == bar)
    208     breakpointAdded(a.js, 10, foo == bar, true)
    209     Location created: a.js:10
    210     breakpointAdded(a.js, 20, , false)
     186    breakpointAdded(a.js, 20, , false)
     187    breakpointAdded(a.js, 10, foo == bar, true)
     188    Location created: a.js:10
    211189
    212190  Navigating to B.
     
    235213    debuggerModel.removeBreakpoint(a.js:10)
    236214    debuggerModel.setBreakpoint(a.js:10:foo == bar)
    237     breakpointAdded(a.js, 10, foo == bar, true)
    238     Location created: a.js:10
    239     breakpointAdded(a.js, 20, , false)
     215    breakpointAdded(a.js, 20, , false)
     216    breakpointAdded(a.js, 10, foo == bar, true)
     217    Location created: a.js:10
    240218  Dumping Storage
    241219    a.js:10 enabled:true condition:foo == bar
     
    256234  Adding UISourceCode: a.js
    257235    debuggerModel.setBreakpoint(a.js:10:foo == bar)
    258     breakpointAdded(a.js, 10, foo == bar, true)
    259     Location created: a.js:10
    260236    debuggerModel.setBreakpoint(a.js:20:)
     237    breakpointAdded(a.js, 10, foo == bar, true)
     238    Location created: a.js:10
    261239    breakpointAdded(a.js, 20, , true)
    262240    Location created: a.js:20
  • trunk/LayoutTests/inspector/debugger/breakpoint-manager.html

    r146973 r146983  
    2020                return null;
    2121            return new WebInspector.DebuggerModel.Location(uiSourceCode.url, lineNumber, 0);
     22        },
     23
     24        isIdentity: function()
     25        {
     26            return true;
    2227        }
    2328    };
     
    3439        {
    3540            return new WebInspector.DebuggerModel.Location(uiSourceCode.url, lineNumber - 10, 0);
     41        },
     42
     43        isIdentity: function()
     44        {
     45            return false;
    3646        }
    3747    };
     
    5161        },
    5262
     63        _scriptForURL: function(url)
     64        {
     65            for (var scriptId in this._scripts) {
     66                var script = this._scripts[scriptId];
     67                if (script.sourceURL === url)
     68                    return script;
     69            }
     70       },
     71
     72        _scheduleSetBeakpointCallback: function(callback, breakpointId, locations)
     73        {
     74            setTimeout(innerCallback.bind(this), 0);
     75
     76            function innerCallback()
     77            {
     78                if (callback)
     79                    callback(breakpointId, locations);
     80                if (window.setBreakpointCallback) {
     81                    var savedCallback = window.setBreakpointCallback;
     82                    delete window.setBreakpointCallback;
     83                    savedCallback();
     84                }
     85            }
     86        },
     87
     88        setBreakpointByURL: function(url, lineNumber, columnNumber, condition, callback)
     89        {
     90            var breakpointId = url + ":" + lineNumber;
     91            if (this._breakpoints[breakpointId]) {
     92                this._scheduleSetBeakpointCallback(callback, null);
     93                return;
     94            }
     95
     96            this._breakpoints[breakpointId] = true;
     97            InspectorTest.addResult("    debuggerModel.setBreakpoint(" + [url, lineNumber, condition].join(":") + ")");
     98
     99            var locations = [];
     100            var script = this._scriptForURL(url);
     101            if (script) {
     102                var location = new WebInspector.DebuggerModel.Location(script.scriptId, lineNumber, 0);
     103                locations.push(location);
     104            }
     105
     106            this._scheduleSetBeakpointCallback(callback, breakpointId, locations);
     107        },
     108
    53109        setBreakpointByScriptLocation: function(location, condition, callback)
    54110        {
    55111            var breakpointId = location.scriptId + ":" + location.lineNumber;
    56112            if (this._breakpoints[breakpointId]) {
    57                 callback(null);
     113                this._scheduleSetBeakpointCallback(callback, null);
    58114                return;
    59115            }
     
    61117            this._breakpoints[breakpointId] = true;
    62118            InspectorTest.addResult("    debuggerModel.setBreakpoint(" + [location.scriptId, location.lineNumber, condition].join(":") + ")");
    63             if (!callback)
    64                 return;
     119
    65120            if (location.lineNumber >= 2000) {
    66                 callback(breakpointId, []);
     121                this._scheduleSetBeakpointCallback(callback, breakpointId, []);
    67122                return;
    68123            }
    69124            if (location.lineNumber >= 1000) {
    70125                var shiftedLocation = {scriptId: location.scriptId, lineNumber: location.lineNumber + 10, columnNumber: location.columnNumber };
    71                 callback(breakpointId, [shiftedLocation]);
     126                this._scheduleSetBeakpointCallback(callback, breakpointId, [shiftedLocation]);
    72127                return;
    73128            }
    74             callback(breakpointId, [location]);
     129
     130            this._scheduleSetBeakpointCallback(callback, breakpointId, [location]);
    75131        },
    76132
     
    239295            var uiSourceCode = addUISourceCode(breakpointManager, "a.js");
    240296            setBreakpoint(breakpointManager, uiSourceCode, 30, "", true);
    241             resetBreakpointManager(breakpointManager, next);
     297            window.setBreakpointCallback = step2.bind(this);
     298
     299            function step2()
     300            {
     301                resetBreakpointManager(breakpointManager, next);
     302            }
    242303        },
    243304
     
    250311            InspectorTest.addResult("  Enabling breakpoint");
    251312            breakpoint.setEnabled(true);
    252             resetBreakpointManager(breakpointManager, next);
     313            window.setBreakpointCallback = step2.bind(this);
     314
     315            function step2()
     316            {
     317                resetBreakpointManager(breakpointManager, next);
     318            }
    253319        },
    254320
     
    258324            var uiSourceCode = addUISourceCode(breakpointManager, "a.js");
    259325            var breakpoint = setBreakpoint(breakpointManager, uiSourceCode, 30, "condition", true);
    260             dumpBreakpointStorage(breakpointManager);
    261             InspectorTest.addResult("  Updating condition");
    262             breakpoint.setCondition("");
    263             resetBreakpointManager(breakpointManager, next);
     326            window.setBreakpointCallback = step2.bind(this);
     327
     328            function step2()
     329            {
     330                dumpBreakpointStorage(breakpointManager);
     331                InspectorTest.addResult("  Updating condition");
     332                breakpoint.setCondition("");
     333                window.setBreakpointCallback = step3.bind(this);
     334            }
     335
     336            function step3()
     337            {
     338                resetBreakpointManager(breakpointManager, next);
     339            }
    264340        },
    265341
     
    268344            var breakpointManager = createBreakpointManager(serializedBreakpoints);
    269345            addUISourceCode(breakpointManager, "a.js");
    270             resetBreakpointManager(breakpointManager, next);
     346            window.setBreakpointCallback = step2.bind(this);
     347
     348            function step2()
     349            {
     350                resetBreakpointManager(breakpointManager, next);
     351            }
    271352        },
    272353
     
    276357            addUISourceCode(breakpointManager, "a.js");
    277358            addUISourceCode(breakpointManager, "a.js");
    278             resetBreakpointManager(breakpointManager, next);
    279         },
    280 
    281         function testRestoreBreakpointsAfterTemporaryUISourceCodeRemoved(next)
     359            window.setBreakpointCallback = step2.bind(this);
     360
     361            function step2()
     362            {
     363                resetBreakpointManager(breakpointManager, next);
     364            }
     365        },
     366
     367        function testRemoveBreakpoints(next)
    282368        {
    283369            var breakpointManager = createBreakpointManager(serializedBreakpoints);
    284             addTemporaryUISourceCode(breakpointManager, "a.js");
    285             addUISourceCode(breakpointManager, "a.js");
    286             resetBreakpointManager(breakpointManager, next);
    287         },
    288 
    289         function testRemoveBreakpoints(next)
    290         {
    291             var breakpointManager = createBreakpointManager(serializedBreakpoints);
    292             var uiSourceCode = addUISourceCode(breakpointManager, "a.js");
    293             setBreakpoint(breakpointManager, uiSourceCode, 30, "", true);
    294 
    295             removeBreakpoint(breakpointManager, uiSourceCode, 30);
    296             removeBreakpoint(breakpointManager, uiSourceCode, 10);
    297             removeBreakpoint(breakpointManager, uiSourceCode, 20);
    298             resetBreakpointManager(breakpointManager, next);
     370            var uiSourceCode = addUISourceCode(breakpointManager, "a.js");
     371            window.setBreakpointCallback = step2.bind(this);
     372
     373            function step2()
     374            {
     375                setBreakpoint(breakpointManager, uiSourceCode, 30, "", true);
     376                window.setBreakpointCallback = step3.bind(this);
     377            }
     378
     379            function step3()
     380            {
     381                removeBreakpoint(breakpointManager, uiSourceCode, 30);
     382                removeBreakpoint(breakpointManager, uiSourceCode, 10);
     383                removeBreakpoint(breakpointManager, uiSourceCode, 20);
     384                resetBreakpointManager(breakpointManager, next);
     385            }
    299386        },
    300387
     
    304391            var uiSourceCode = addUISourceCode(breakpointManager, "a.js");
    305392            setBreakpoint(breakpointManager, uiSourceCode, 1015, "", true);
    306             resetBreakpointManager(breakpointManager, next);
     393            window.setBreakpointCallback = step2.bind(this);
     394
     395            function step2()
     396            {
     397                resetBreakpointManager(breakpointManager, next);
     398            }
    307399        },
    308400
     
    312404            var uiSourceCode = addUISourceCode(breakpointManager, "a.js");
    313405            setBreakpoint(breakpointManager, uiSourceCode, 1015, "", true);
    314             setBreakpoint(breakpointManager, uiSourceCode, 1015, "", true);
    315             resetBreakpointManager(breakpointManager, next);
     406            window.setBreakpointCallback = step2.bind(this);
     407
     408            function step2()
     409            {
     410                setBreakpoint(breakpointManager, uiSourceCode, 1015, "", true);
     411                window.setBreakpointCallback = step3.bind(this);
     412            }
     413
     414            function step3()
     415            {
     416                resetBreakpointManager(breakpointManager, next);
     417            }
    316418        },
    317419
     
    321423            var uiSourceCode = addUISourceCode(breakpointManager, "a.js");
    322424            breakpointManager.setBreakpoint(uiSourceCode, 2500, "", true);
    323             resetBreakpointManager(breakpointManager, next);
    324         },
     425            window.setBreakpointCallback = step2.bind(this);
     426
     427            function step2()
     428            {
     429                resetBreakpointManager(breakpointManager, next);
     430            }
     431       },
    325432
    326433        function testNavigation(next)
     
    328435            var breakpointManager = createBreakpointManager(serializedBreakpoints);
    329436            var uiSourceCodeA = addUISourceCode(breakpointManager, "a.js");
    330 
    331             InspectorTest.addResult("\n  Navigating to B.");
    332             breakpointManager._debuggerModel.reset();
    333             resetWorkspace(breakpointManager);
    334             var uiSourceCodeB = addUISourceCode(breakpointManager, "b.js");
    335 
    336             InspectorTest.addResult("\n  Navigating back to A.");
    337             breakpointManager._debuggerModel.reset();
    338             resetWorkspace(breakpointManager);
    339             InspectorTest.addResult("  Resolving provisional breakpoint.");
    340             addTemporaryUISourceCode(breakpointManager, "a.js")           
    341             var eventData = { breakpointId: "a.js:10", location: { scriptId: "a.js", lineNumber: 11, columnNumber: 5 }};
    342             breakpointManager._debuggerModel.dispatchEventToListeners(WebInspector.DebuggerModel.Events.BreakpointResolved, eventData);
    343             addUISourceCode(breakpointManager, "a.js");
    344             resetBreakpointManager(breakpointManager, next);
     437            window.setBreakpointCallback = step2.bind(this);
     438
     439            function step2()
     440            {
     441                InspectorTest.addResult("\n  Navigating to B.");
     442                breakpointManager._debuggerModel.reset();
     443                resetWorkspace(breakpointManager);
     444                var uiSourceCodeB = addUISourceCode(breakpointManager, "b.js");
     445                window.setBreakpointCallback = step3.bind(this);
     446            }
     447
     448            function step3()
     449            {
     450                InspectorTest.addResult("\n  Navigating back to A.");
     451                breakpointManager._debuggerModel.reset();
     452                resetWorkspace(breakpointManager);
     453                InspectorTest.addResult("  Resolving provisional breakpoint.");
     454                addTemporaryUISourceCode(breakpointManager, "a.js")           
     455                var eventData = { breakpointId: "a.js:10", location: { scriptId: "a.js", lineNumber: 11, columnNumber: 5 }};
     456                breakpointManager._debuggerModel.dispatchEventToListeners(WebInspector.DebuggerModel.Events.BreakpointResolved, eventData);
     457                addUISourceCode(breakpointManager, "a.js");
     458                window.setBreakpointCallback = step4.bind(this);
     459            }
     460
     461            function step4()
     462            {
     463                resetBreakpointManager(breakpointManager, next);
     464            }
    345465        },
    346466
     
    354474            var breakpointManager = createBreakpointManager(serializedBreakpoints);
    355475            var uiSourceCodeA = addUISourceCode(breakpointManager, "a.js");
    356             InspectorTest.addResult("\n  Toggling source mapping.");
    357             breakpointManager._debuggerModel.pushSourceMapping(shiftingMapping);
    358             InspectorTest.addResult("\n  Toggling source mapping back.");
    359             breakpointManager._debuggerModel.disableSourceMapping(shiftingMapping);
    360             resetBreakpointManager(breakpointManager, next);
     476            window.setBreakpointCallback = step2.bind(this);
     477
     478            function step2()
     479            {
     480                window.setBreakpointCallback = step3.bind(this);
     481            }
     482
     483            function step3()
     484            {
     485                InspectorTest.addResult("\n  Toggling source mapping.");
     486                breakpointManager._debuggerModel.pushSourceMapping(shiftingMapping);
     487                InspectorTest.addResult("\n  Toggling source mapping back.");
     488                breakpointManager._debuggerModel.disableSourceMapping(shiftingMapping);
     489                resetBreakpointManager(breakpointManager, next);
     490            }
    361491        },
    362492
     
    368498            var breakpointManager = createBreakpointManager(serializedBreakpoints);
    369499            var uiSourceCode = addUISourceCode(breakpointManager, "a.js");
    370             breakpointManager._debuggerModel.reset();
    371             resetWorkspace(breakpointManager);
    372             InspectorTest.addResult("  Resolving provisional breakpoint.");
    373             addTemporaryUISourceCode(breakpointManager, "a.js")           
    374             var eventData = { breakpointId: "a.js:10", location: { scriptId: "a.js", lineNumber: 11, columnNumber: 5 }};
    375             breakpointManager._debuggerModel.dispatchEventToListeners(WebInspector.DebuggerModel.Events.BreakpointResolved, eventData);
    376             var breakpoints = breakpointManager._breakpoints.keys();
    377             InspectorTest.assertEquals(breakpoints.length, 1, "Exactly one breakpoint should be registered in breakpoint manager.");
    378             InspectorTest.assertTrue(!breakpoints[0]._primaryUILocation, "_primaryUILocation field should be cleared for provisional breapoint.");
    379             resetBreakpointManager(breakpointManager, next);
     500            window.setBreakpointCallback = step2.bind(this);
     501
     502            function step2()
     503            {
     504                breakpointManager._debuggerModel.reset();
     505                resetWorkspace(breakpointManager);
     506                InspectorTest.addResult("  Resolving provisional breakpoint.");
     507                addTemporaryUISourceCode(breakpointManager, "a.js")           
     508                var eventData = { breakpointId: "a.js:10", location: { scriptId: "a.js", lineNumber: 11, columnNumber: 5 }};
     509                breakpointManager._debuggerModel.dispatchEventToListeners(WebInspector.DebuggerModel.Events.BreakpointResolved, eventData);
     510                var breakpoints = breakpointManager._breakpoints.keys();
     511                InspectorTest.assertEquals(breakpoints.length, 1, "Exactly one breakpoint should be registered in breakpoint manager.");
     512                InspectorTest.assertTrue(!breakpoints[0]._primaryUILocation, "_primaryUILocation field should be cleared for provisional breapoint.");
     513                resetBreakpointManager(breakpointManager, next);
     514            }
    380515        }
    381516    ]);
  • trunk/Source/WebCore/ChangeLog

    r146982 r146983  
     12013-03-27  Vsevolod Vlasov  <vsevik@chromium.org>
     2
     3        Web Inspector: Breakpoint manager should restore breakpoints when uiSourceCode is added.
     4        https://bugs.webkit.org/show_bug.cgi?id=113381
     5
     6        Reviewed by Pavel Feldman.
     7
     8        Breakpoint manager now restores breakpoints on UISourceCodeAdded event.
     9        Breakpoint manager now only resets breakpoints in debugger when source mapping is changed to/from non identity one.
     10
     11        * inspector/front-end/BreakpointManager.js:
     12        (WebInspector.BreakpointManager.prototype._uiSourceCodeAdded):
     13        (WebInspector.BreakpointManager.prototype._resetBreakpoints):
     14        (WebInspector.BreakpointManager.prototype._uiSourceCodeMappingChanged):
     15        * inspector/front-end/CompilerScriptMapping.js:
     16        (WebInspector.CompilerScriptMapping.prototype.get isIdentity):
     17        * inspector/front-end/DefaultScriptMapping.js:
     18        (WebInspector.DefaultScriptMapping.prototype.isIdentity):
     19        * inspector/front-end/ResourceScriptMapping.js:
     20        (WebInspector.ResourceScriptMapping.prototype.isIdentity):
     21        * inspector/front-end/SASSSourceMapping.js:
     22        (WebInspector.SASSSourceMapping.prototype.isIdentity):
     23        * inspector/front-end/ScriptSnippetModel.js:
     24        (WebInspector.SnippetScriptMapping.prototype.isIdentity):
     25        * inspector/front-end/SourceMapping.js:
     26        (WebInspector.SourceMapping.prototype.isIdentity):
     27        * inspector/front-end/StylesSourceMapping.js:
     28        (WebInspector.StylesSourceMapping.prototype.isIdentity):
     29        * inspector/front-end/UISourceCode.js:
     30        (WebInspector.UISourceCode.prototype.setSourceMapping):
     31
    1322013-03-27  Yury Semikhatsky  <yurys@chromium.org>
    233
  • trunk/Source/WebCore/inspector/front-end/BreakpointManager.js

    r146973 r146983  
    9292    {
    9393        var uiSourceCode = /** @type {WebInspector.UISourceCode} */ (event.data);
     94        this._restoreBreakpoints(uiSourceCode);
    9495        if (uiSourceCode.contentType() === WebInspector.resourceTypes.Script || uiSourceCode.contentType() === WebInspector.resourceTypes.Document) {
    9596            uiSourceCode.addEventListener(WebInspector.UISourceCode.Events.SourceMappingChanged, this._uiSourceCodeMappingChanged, this);
     
    108109
    109110    /**
     111     * @param {WebInspector.UISourceCode} uiSourceCode
     112     */
     113    _resetBreakpoints: function(uiSourceCode)
     114    {
     115        var sourceFileId = WebInspector.BreakpointManager.sourceFileId(uiSourceCode);
     116        var breakpoints = this._breakpoints.keys();
     117        for (var i = 0; i < breakpoints.length; ++i) {
     118            var breakpoint = breakpoints[i];
     119            if (breakpoint._sourceFileId !== sourceFileId)
     120                return;
     121            if (breakpoint.enabled()) {
     122                breakpoint._removeFromDebugger();
     123                breakpoint._setInDebugger();
     124            }
     125        }
     126    },
     127
     128    /**
    110129     * @param {WebInspector.Event} event
    111130     */
    112131    _uiSourceCodeMappingChanged: function(event)
    113132    {
     133        var identityHasChanged = /** @type {boolean} */ (event.data.identityHasChanged);
     134        if (!identityHasChanged)
     135            return;
    114136        var uiSourceCode = /** @type {WebInspector.UISourceCode} */ (event.target);
    115         this._restoreBreakpoints(uiSourceCode);
     137        this._resetBreakpoints(uiSourceCode);
    116138    },
    117139
     
    273295            this._breakpointsForUISourceCode.remove(uiSourceCode);
    274296
    275             var breakpoints = this.breakpointsForUISourceCode(uiSourceCode);
     297            breakpoints = this.breakpointsForUISourceCode(uiSourceCode);
    276298            for (var j = 0; j < breakpoints.length; ++j) {
    277299                var breakpoint = breakpoints[j];
     
    483505    _setInDebugger: function()
    484506    {
     507        console.assert(!this._debuggerId);
    485508        var rawLocation = this._primaryUILocation.uiLocationToRawLocation();
    486509        var debuggerModelLocation = /** @type {WebInspector.DebuggerModel.Location} */ (rawLocation);
  • trunk/Source/WebCore/inspector/front-end/CompilerScriptMapping.js

    r143448 r146983  
    8686        var entry = sourceMap.findEntryReversed(uiSourceCode.url, lineNumber);
    8787        return WebInspector.debuggerModel.createRawLocation(this._scriptForSourceMap.get(sourceMap), entry[0], entry[1]);
     88    },
     89
     90    /**
     91     * @return {boolean}
     92     */
     93    isIdentity: function()
     94    {
     95        return false;
    8896    },
    8997
  • trunk/Source/WebCore/inspector/front-end/DefaultScriptMapping.js

    r146191 r146983  
    6969        var script = WebInspector.debuggerModel.scriptForId(scriptId);
    7070        return WebInspector.debuggerModel.createRawLocation(script, lineNumber, columnNumber);
     71    },
     72
     73    /**
     74     * @return {boolean}
     75     */
     76    isIdentity: function()
     77    {
     78        return true;
    7179    },
    7280
  • trunk/Source/WebCore/inspector/front-end/ResourceScriptMapping.js

    r146112 r146983  
    7474
    7575    /**
     76     * @return {boolean}
     77     */
     78    isIdentity: function()
     79    {
     80        return true;
     81    },
     82
     83    /**
    7684     * @param {WebInspector.Script} script
    7785     */
  • trunk/Source/WebCore/inspector/front-end/SASSSourceMapping.js

    r144434 r146983  
    273273    },
    274274
     275    /**
     276     * @return {boolean}
     277     */
     278    isIdentity: function()
     279    {
     280        return false;
     281    },
     282
    275283    _reset: function()
    276284    {
  • trunk/Source/WebCore/inspector/front-end/ScriptSnippetModel.js

    r144463 r146983  
    488488
    489489    /**
     490     * @return {boolean}
     491     */
     492    isIdentity: function()
     493    {
     494        return true;
     495    },
     496
     497    /**
    490498     * @param {string} sourceURL
    491499     * @return {string|null}
  • trunk/Source/WebCore/inspector/front-end/SourceMapping.js

    r135142 r146983  
    4949     * @return {WebInspector.RawLocation}
    5050     */
    51     uiLocationToRawLocation: function(uiSourceCode, lineNumber, columnNumber) { }
     51    uiLocationToRawLocation: function(uiSourceCode, lineNumber, columnNumber) { },
     52
     53    /**
     54     * @return {boolean}
     55     */
     56    isIdentity: function() { }
    5257}
    5358
  • trunk/Source/WebCore/inspector/front-end/StylesSourceMapping.js

    r143448 r146983  
    7070    },
    7171
     72    /**
     73     * @return {boolean}
     74     */
     75    isIdentity: function()
     76    {
     77        return true;
     78    },
     79
    7280    _resourceAdded: function(event)
    7381    {
  • trunk/Source/WebCore/inspector/front-end/UISourceCode.js

    r145543 r146983  
    664664    setSourceMapping: function(sourceMapping)
    665665    {
     666        var wasIdentity = this._sourceMapping ? this._sourceMapping.isIdentity() : true;
    666667        this._sourceMapping = sourceMapping;
    667         this.dispatchEventToListeners(WebInspector.UISourceCode.Events.SourceMappingChanged, null);
     668        var data = {}
     669        data.isIdentity = sourceMapping ? sourceMapping.isIdentity() : true;
     670        data.identityHasChanged = data.isIdentity !== wasIdentity;
     671        this.dispatchEventToListeners(WebInspector.UISourceCode.Events.SourceMappingChanged, data);
    668672    },
    669673
Note: See TracChangeset for help on using the changeset viewer.