Changeset 115064 in webkit


Ignore:
Timestamp:
Apr 24, 2012 8:46:35 AM (12 years ago)
Author:
pfeldman@chromium.org
Message:

Web Inspector: encapsulate live location into the Script.
https://bugs.webkit.org/show_bug.cgi?id=84722

Reviewed by Yury Semikhatsky.

Source/WebCore:

Live location is just a location on the script. The way it is implemented today involves too many indirections.

  • inspector/front-end/CompilerScriptMapping.js:
  • inspector/front-end/DebuggerModel.js:

(WebInspector.DebuggerModel.prototype.setBreakpointByScriptLocation):
(WebInspector.DebuggerModel.prototype.scriptForId):

  • inspector/front-end/DebuggerPresentationModel.js:

(WebInspector.DebuggerPresentationModel.prototype.createLiveLocation):
(WebInspector.DebuggerPresentationModel.prototype._addConsoleMessageToScript):
(WebInspector.DebuggerPresentationModel.prototype._debuggerPaused):
(WebInspector.DebuggerPresentationModel.prototype.set selectedCallFrame):
(WebInspector.PresentationCallFrame.prototype.uiLocation):
(WebInspector.DebuggerPresentationModel.CallFramePlacard):
(WebInspector.DebuggerPresentationModel.Linkifier.prototype.linkifyRawLocation):

  • inspector/front-end/RawSourceCode.js:
  • inspector/front-end/ResourceScriptMapping.js:

(WebInspector.ResourceScriptMapping.prototype.addScript):
(WebInspector.ResourceScriptMapping.prototype._uiSourceCodeChanged):
(WebInspector.ResourceScriptMapping.prototype._bindScriptToRawSourceCode):

  • inspector/front-end/Script.js:

(WebInspector.Script):
(WebInspector.Script.prototype.isInlineScript):
(WebInspector.Script.prototype.setSourceMapping):
(WebInspector.Script.prototype.createLocation):
(WebInspector.Script.Location):
(WebInspector.Script.Location.prototype.dispose):
(WebInspector.Script.Location.prototype._update):

  • inspector/front-end/ScriptMapping.js:

(WebInspector.UILocation):
(WebInspector.SourceMapping):
(WebInspector.SourceMapping.prototype.rawLocationToUILocation):
(WebInspector.SourceMapping.prototype.uiLocationToRawLocation):
(WebInspector.MainScriptMapping):
(WebInspector.MainScriptMapping.prototype.addScript):
(WebInspector.MainScriptMapping.prototype.reset):

  • inspector/front-end/SnippetsModel.js:

(WebInspector.SnippetsScriptMapping.prototype._createUISourceCodeForScript):

LayoutTests:

  • http/tests/inspector/debugger-test.js:

(initialize_DebuggerTest):

  • inspector/debugger/linkifier.html:
Location:
trunk
Files:
12 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r115062 r115064  
     12012-04-24  Pavel Feldman  <pfeldman@chromium.org>
     2
     3        Web Inspector: encapsulate live location into the Script.
     4        https://bugs.webkit.org/show_bug.cgi?id=84722
     5
     6        Reviewed by Yury Semikhatsky.
     7
     8        * http/tests/inspector/debugger-test.js:
     9        (initialize_DebuggerTest):
     10        * inspector/debugger/linkifier.html:
     11
    1122012-04-24  Mikhail Naganov  <mnaganov@chromium.org>
    213
  • trunk/LayoutTests/http/tests/inspector/debugger-test.js

    r115032 r115064  
    106106    for (var i = 0; i < callFrames.length; i++) {
    107107        var frame = callFrames[i];
    108         var script = WebInspector.debuggerModel.scriptForSourceID(frame.location.scriptId);
     108        var script = WebInspector.debuggerModel.scriptForId(frame.location.scriptId);
    109109        var url;
    110110        var lineNumber;
  • trunk/LayoutTests/inspector/debugger/linkifier.html

    r110434 r115064  
    1111    var linkifier;
    1212    var link;
     13    var script;
    1314
    1415    function waitForScripts()
     
    2021                return;
    2122
    22             var script = event.data;
     23            script = event.data;
    2324            if (script.sourceURL === WebInspector.inspectedPageURL) {
    2425                continued = true;
     
    6869    function liveLocationsCount()
    6970    {
    70         var locations = WebInspector.debuggerPresentationModel._scriptMapping._liveLocationsForScriptId;
    71         var count = 0;
    72         for (id in locations)
    73             count += locations[id].length;
    74         return count;
     71        return script._locations.length;
    7572    }
    7673}
  • trunk/Source/WebCore/ChangeLog

    r115063 r115064  
     12012-04-24  Pavel Feldman  <pfeldman@chromium.org>
     2
     3        Web Inspector: encapsulate live location into the Script.
     4        https://bugs.webkit.org/show_bug.cgi?id=84722
     5
     6        Reviewed by Yury Semikhatsky.
     7
     8        Live location is just a location on the script. The way it is implemented today involves too many indirections.
     9
     10        * inspector/front-end/CompilerScriptMapping.js:
     11        * inspector/front-end/DebuggerModel.js:
     12        (WebInspector.DebuggerModel.prototype.setBreakpointByScriptLocation):
     13        (WebInspector.DebuggerModel.prototype.scriptForId):
     14        * inspector/front-end/DebuggerPresentationModel.js:
     15        (WebInspector.DebuggerPresentationModel.prototype.createLiveLocation):
     16        (WebInspector.DebuggerPresentationModel.prototype._addConsoleMessageToScript):
     17        (WebInspector.DebuggerPresentationModel.prototype._debuggerPaused):
     18        (WebInspector.DebuggerPresentationModel.prototype.set selectedCallFrame):
     19        (WebInspector.PresentationCallFrame.prototype.uiLocation):
     20        (WebInspector.DebuggerPresentationModel.CallFramePlacard):
     21        (WebInspector.DebuggerPresentationModel.Linkifier.prototype.linkifyRawLocation):
     22        * inspector/front-end/RawSourceCode.js:
     23        * inspector/front-end/ResourceScriptMapping.js:
     24        (WebInspector.ResourceScriptMapping.prototype.addScript):
     25        (WebInspector.ResourceScriptMapping.prototype._uiSourceCodeChanged):
     26        (WebInspector.ResourceScriptMapping.prototype._bindScriptToRawSourceCode):
     27        * inspector/front-end/Script.js:
     28        (WebInspector.Script):
     29        (WebInspector.Script.prototype.isInlineScript):
     30        (WebInspector.Script.prototype.setSourceMapping):
     31        (WebInspector.Script.prototype.createLocation):
     32        (WebInspector.Script.Location):
     33        (WebInspector.Script.Location.prototype.dispose):
     34        (WebInspector.Script.Location.prototype._update):
     35        * inspector/front-end/ScriptMapping.js:
     36        (WebInspector.UILocation):
     37        (WebInspector.SourceMapping):
     38        (WebInspector.SourceMapping.prototype.rawLocationToUILocation):
     39        (WebInspector.SourceMapping.prototype.uiLocationToRawLocation):
     40        (WebInspector.MainScriptMapping):
     41        (WebInspector.MainScriptMapping.prototype.addScript):
     42        (WebInspector.MainScriptMapping.prototype.reset):
     43        * inspector/front-end/SnippetsModel.js:
     44        (WebInspector.SnippetsScriptMapping.prototype._createUISourceCodeForScript):
     45
    1462012-04-24  Yury Semikhatsky  <yurys@chromium.org>
    247
  • trunk/Source/WebCore/inspector/front-end/CompilerScriptMapping.js

    r114892 r115064  
    101101            this._sourceMapForScriptId[script.scriptId] = sourceMap;
    102102            var uiSourceCodes = this._uiSourceCodesForSourceMap(sourceMap);
    103             var data = { scriptId: script.scriptId, uiSourceCodes: uiSourceCodes };
    104             this.dispatchEventToListeners(WebInspector.ScriptMapping.Events.ScriptBound, data);
     103            script.setSourceMapping(this);
    105104            return;
    106105        }
     
    130129        var data = { removedItems: [], addedItems: uiSourceCodeList };
    131130        this.dispatchEventToListeners(WebInspector.ScriptMapping.Events.UISourceCodeListChanged, data);
    132         data = { scriptId: script.scriptId, uiSourceCodes: uiSourceCodeList };
    133         this.dispatchEventToListeners(WebInspector.ScriptMapping.Events.ScriptBound, data);
     131        script.setSourceMapping(this);
    134132    },
    135133
  • trunk/Source/WebCore/inspector/front-end/DebuggerModel.js

    r115032 r115064  
    140140    setBreakpointByScriptLocation: function(location, condition, callback)
    141141    {
    142         var script = this.scriptForSourceID(location.scriptId);
     142        var script = this.scriptForId(location.scriptId);
    143143        if (script.sourceURL)
    144144            this.setBreakpoint(script.sourceURL, location.lineNumber, location.columnNumber, condition, callback);
     
    239239     * @return {WebInspector.Script}
    240240     */
    241     scriptForSourceID: function(scriptId)
     241    scriptForId: function(scriptId)
    242242    {
    243243        return this._scripts[scriptId] || null;
  • trunk/Source/WebCore/inspector/front-end/DebuggerPresentationModel.js

    r115032 r115064  
    116116    /**
    117117     * @param {DebuggerAgent.Location} rawLocation
    118      * @param {function(WebInspector.UILocation)} updateDelegate
    119      * @return {WebInspector.LiveLocation}
     118     * @param {function(WebInspector.UILocation):(boolean|undefined)} updateDelegate
     119     * @return {WebInspector.Script.Location}
    120120     */
    121121    createLiveLocation: function(rawLocation, updateDelegate)
    122122    {
    123         return this._scriptMapping.createLiveLocation(rawLocation, updateDelegate);
     123        var script = WebInspector.debuggerModel.scriptForId(rawLocation.scriptId);
     124        return script.createLocation(rawLocation, updateDelegate);
    124125    },
    125126
     
    192193    {
    193194        var rawLocation = this.uiLocationToRawLocation(uiSourceCode, 0, 0);
    194         var script = WebInspector.debuggerModel.scriptForSourceID(rawLocation.scriptId);
     195        var script = WebInspector.debuggerModel.scriptForId(rawLocation.scriptId);
    195196
    196197        /**
     
    253254        }
    254255        var liveLocation = this.createLiveLocation(rawLocation, updateLocation.bind(this));
    255         liveLocation.init();
    256256        this._consoleMessageLiveLocations.push(liveLocation);
    257257    },
     
    324324        for (var i = 0; i < callFrames.length; ++i) {
    325325            var callFrame = callFrames[i];
    326             if (WebInspector.debuggerModel.scriptForSourceID(callFrame.location.scriptId))
     326            if (WebInspector.debuggerModel.scriptForId(callFrame.location.scriptId))
    327327                this._presentationCallFrames.push(new WebInspector.PresentationCallFrame(callFrame, i, this));
    328328        }
     
    357357        }
    358358        this._executionLineLiveLocation = this.createLiveLocation(callFrame._callFrame.location, updateExecutionLine.bind(this));
    359         this._executionLineLiveLocation.init();
    360359    },
    361360
     
    554553        {
    555554            callback(uiLocation);
    556             liveLocation.dispose();
    557         }
    558         var liveLocation = this._model.createLiveLocation(this._callFrame.location, locationUpdated.bind(this));
    559         liveLocation.init();
     555            return true;
     556        }
     557        this._model.createLiveLocation(this._callFrame.location, locationUpdated.bind(this));
    560558    }
    561559}
     
    571569    WebInspector.Placard.call(this, callFrame._callFrame.functionName || WebInspector.UIString("(anonymous function)"), "");
    572570    this._liveLocation = model.createLiveLocation(callFrame._callFrame.location, this._update.bind(this));
    573     this._liveLocation.init();
    574571}
    575572
     
    746743    linkifyRawLocation: function(rawLocation, classes)
    747744    {
    748         if (!WebInspector.debuggerModel.scriptForSourceID(rawLocation.scriptId))
     745        if (!WebInspector.debuggerModel.scriptForId(rawLocation.scriptId))
    749746            return null;
    750747        var anchor = WebInspector.linkifyURLAsNode("", "", classes, false);
    751748        var liveLocation = this._model.createLiveLocation(rawLocation, this._updateAnchor.bind(this, anchor));
    752         liveLocation.init();
    753749        this._liveLocations.push(liveLocation);
    754750        return anchor;
  • trunk/Source/WebCore/inspector/front-end/RawSourceCode.js

    r114892 r115064  
    240240/**
    241241 * @interface
     242 * @extends {WebInspector.SourceMapping}
    242243 */
    243244WebInspector.RawSourceCode.SourceMapping = function()
     
    246247
    247248WebInspector.RawSourceCode.SourceMapping.prototype = {
    248     /**
    249      * @param {DebuggerAgent.Location} rawLocation
    250      * @return {WebInspector.UILocation}
    251      */
    252     rawLocationToUILocation: function(rawLocation) { },
    253 
    254     /**
    255      * @param {WebInspector.UISourceCode} uiSourceCode
    256      * @param {number} lineNumber
    257      * @param {number} columnNumber
    258      * @return {DebuggerAgent.Location}
    259      */
    260     uiLocationToRawLocation: function(uiSourceCode, lineNumber, columnNumber) { },
    261 
    262249    /**
    263250     * @return {WebInspector.UISourceCode}
     
    354341    }
    355342}
    356 
    357 /**
    358  * @constructor
    359  * @param {WebInspector.UISourceCode} uiSourceCode
    360  * @param {number} lineNumber
    361  * @param {number} columnNumber
    362  */
    363 WebInspector.UILocation = function(uiSourceCode, lineNumber, columnNumber)
    364 {
    365     this.uiSourceCode = uiSourceCode;
    366     this.lineNumber = lineNumber;
    367     this.columnNumber = columnNumber;
    368 }
  • trunk/Source/WebCore/inspector/front-end/ResourceScriptMapping.js

    r114135 r115064  
    118118        this._rawSourceCodes.push(rawSourceCode);
    119119        this._bindScriptToRawSourceCode(script, rawSourceCode);
    120 
    121120        if (isInlineScript)
    122121            this._rawSourceCodeForDocumentURL[script.sourceURL] = rawSourceCode;
     
    150149
    151150        var scriptIds = [];
    152         for (var i = 0; i < rawSourceCode._scripts.length; ++i)
     151        for (var i = 0; i < rawSourceCode._scripts.length; ++i) {
    153152            scriptIds.push(rawSourceCode._scripts[i].scriptId);
     153            rawSourceCode._scripts[i].setSourceMapping(this);
     154        }
    154155        var removedItems = removedItem ? [removedItem] : [];
    155156        var addedItems = addedItem ? [addedItem] : [];
    156157
    157         if (removedItem) {
    158             for (var i = 0; i < scriptIds.length; ++i) {
    159                 var data = { scriptId: scriptIds[i], uiSourceCodes: [removedItem] };
    160                 this.dispatchEventToListeners(WebInspector.ScriptMapping.Events.ScriptUnbound, data);
    161             }
    162         }
    163 
    164158        var data = { removedItems: removedItems, addedItems: addedItems };
    165159        this.dispatchEventToListeners(WebInspector.ScriptMapping.Events.UISourceCodeListChanged, data);
    166 
    167         if (addedItem) {
    168             for (var i = 0; i < scriptIds.length; ++i) {
    169                 data = { scriptId: scriptIds[i], uiSourceCodes: [addedItem] };
    170                 this.dispatchEventToListeners(WebInspector.ScriptMapping.Events.ScriptBound, data);
    171             }
    172         }
    173160    },
    174161
     
    181168        this._rawSourceCodeForScriptId[script.scriptId] = rawSourceCode;
    182169        this._rawSourceCodeForURL[script.sourceURL] = rawSourceCode;
     170        script.setSourceMapping(this);
    183171    },
    184172
  • trunk/Source/WebCore/inspector/front-end/Script.js

    r113707 r115064  
    4545    this.isContentScript = isContentScript;
    4646    this.sourceMapURL = sourceMapURL;
     47    this._locations = [];
    4748}
    4849
     
    138139    {
    139140        return !!this.sourceURL && this.lineOffset !== 0 && this.columnOffset !== 0;
     141    },
     142
     143   
     144    /**
     145     * @param {WebInspector.SourceMapping} sourceMapping
     146     */
     147    setSourceMapping: function(sourceMapping)
     148    {
     149        this._sourceMapping = sourceMapping;
     150        for (var i = 0; i < this._locations.length; ++i)
     151            this._locations[i]._update();
     152    },
     153
     154    /**
     155     * @param {DebuggerAgent.Location} rawLocation
     156     * @param {function(WebInspector.UILocation):(boolean|undefined)} updateDelegate
     157     * @return {WebInspector.Script.Location}
     158     */
     159    createLocation: function(rawLocation, updateDelegate)
     160    {
     161        var location = new WebInspector.Script.Location(this, rawLocation, updateDelegate);
     162        this._locations.push(location);
     163        location._update();
     164        return location;
    140165    }
    141166}
     167
     168/**
     169 * @constructor
     170 * @param {WebInspector.Script} script
     171 * @param {DebuggerAgent.Location} rawLocation
     172 * @param {function(WebInspector.UILocation):(boolean|undefined)} updateDelegate
     173 */
     174WebInspector.Script.Location = function(script, rawLocation, updateDelegate)
     175{
     176    this._script = script;
     177    this._rawLocation = rawLocation;
     178    this._updateDelegate = updateDelegate;
     179}
     180
     181WebInspector.Script.Location.prototype = {
     182    dispose: function()
     183    {
     184        this._script._locations.remove(this);
     185    },
     186
     187    _update: function()
     188    {
     189        if (!this._script._sourceMapping)
     190            return;
     191        var uiLocation = this._script._sourceMapping.rawLocationToUILocation(this._rawLocation);
     192        if (uiLocation) {
     193            var oneTime = this._updateDelegate(uiLocation);
     194            if (oneTime)
     195                this.dispose();
     196        }
     197    }
     198}
  • trunk/Source/WebCore/inspector/front-end/ScriptMapping.js

    r111694 r115064  
    3131/**
    3232 * @constructor
     33 * @param {WebInspector.UISourceCode} uiSourceCode
     34 * @param {number} lineNumber
     35 * @param {number} columnNumber
     36 */
     37WebInspector.UILocation = function(uiSourceCode, lineNumber, columnNumber)
     38{
     39    this.uiSourceCode = uiSourceCode;
     40    this.lineNumber = lineNumber;
     41    this.columnNumber = columnNumber;
     42}
     43
     44/**
     45 * @interface
     46 */
     47WebInspector.SourceMapping = function()
     48{
     49}
     50
     51WebInspector.SourceMapping.prototype = {
     52    /**
     53     * @param {DebuggerAgent.Location} rawLocation
     54     * @return {WebInspector.UILocation}
     55     */
     56    rawLocationToUILocation: function(rawLocation) { },
     57
     58    /**
     59     * @param {WebInspector.UISourceCode} uiSourceCode
     60     * @param {number} lineNumber
     61     * @param {number} columnNumber
     62     * @return {DebuggerAgent.Location}
     63     */
     64    uiLocationToRawLocation: function(uiSourceCode, lineNumber, columnNumber) { }
     65}
     66
     67/**
     68 * @constructor
    3369 * @extends {WebInspector.Object}
     70 * @implements {WebInspector.SourceMapping}
    3471 */
    3572WebInspector.ScriptMapping = function()
     
    3875
    3976WebInspector.ScriptMapping.Events = {
    40     UISourceCodeListChanged: "ui-source-code-list-changed",
    41     ScriptBound: "script-bound",
    42     ScriptUnbound: "script-unbound",
     77    UISourceCodeListChanged: "ui-source-code-list-changed"
    4378}
    4479
     
    81116    this._mappings.push(this._snippetsMapping);
    82117
    83     for (var i = 0; i < this._mappings.length; ++i) {
     118    for (var i = 0; i < this._mappings.length; ++i)
    84119        this._mappings[i].addEventListener(WebInspector.ScriptMapping.Events.UISourceCodeListChanged, this._handleUISourceCodeListChanged, this);
    85         this._mappings[i].addEventListener(WebInspector.ScriptMapping.Events.ScriptBound, this._handleScriptBound, this);
    86         this._mappings[i].addEventListener(WebInspector.ScriptMapping.Events.ScriptUnbound, this._handleScriptUnbound, this);
    87     }
    88120
    89121    this._mappingForScriptId = {};
    90122    this._mappingForUISourceCode = new Map();
    91     this._liveLocationsForScriptId = {};
    92123}
    93124
     
    115146    {
    116147        return this._mappingForUISourceCode.get(uiSourceCode).uiLocationToRawLocation(uiSourceCode, lineNumber, columnNumber);
    117     },
    118 
    119     /**
    120      * @param {DebuggerAgent.Location} rawLocation
    121      * @param {function(WebInspector.UILocation)} updateDelegate
    122      * @return {WebInspector.LiveLocation}
    123      */
    124     createLiveLocation: function(rawLocation, updateDelegate)
    125     {
    126         return new WebInspector.LiveLocation(this, rawLocation, updateDelegate);
    127     },
    128 
    129     _registerLiveLocation: function(scriptId, liveLocation)
    130     {
    131         this._liveLocationsForScriptId[scriptId].push(liveLocation)
    132         liveLocation._update();
    133     },
    134 
    135     _unregisterLiveLocation: function(scriptId, liveLocation)
    136     {
    137         if (this._liveLocationsForScriptId[scriptId])
    138             this._liveLocationsForScriptId[scriptId].remove(liveLocation);
    139     },
    140 
    141     _updateLiveLocation: function(scriptId)
    142     {
    143         var liveLocations = this._liveLocationsForScriptId[scriptId];
    144         for (var j = 0; j < liveLocations.length; ++j)
    145             liveLocations[j]._update();
    146148    },
    147149
     
    165167    addScript: function(script)
    166168    {
    167         this._liveLocationsForScriptId[script.scriptId] = [];
    168 
    169169        var mapping = this._mappingForScript(script);
    170170        this._mappingForScriptId[script.scriptId] = mapping;
     
    208208
    209209    /**
    210      * @param {WebInspector.Event} event
    211      */
    212     _handleScriptBound: function(event)
    213     {
    214         var scriptId = /** @type {number} */ event.data.scriptId;
    215         this._updateLiveLocation(scriptId);
    216     },
    217 
    218     /**
    219      * @param {WebInspector.Event} event
    220      */
    221     _handleScriptUnbound: function(event)
    222     {
    223         var scriptId = /** @type {number} */ event.data.scriptId;
    224         this._updateLiveLocation(scriptId);
    225     },
    226 
    227 
    228     /**
    229210     * @param {boolean} formatSource
    230211     */
     
    249230        this._mappingForScriptId = {};
    250231        this._mappingForUISourceCode = new Map();
    251         this._liveLocationsForScriptId = {};
    252232    }
    253233}
    254234
    255235WebInspector.MainScriptMapping.prototype.__proto__ = WebInspector.Object.prototype;
    256 
    257 /**
    258  * @constructor
    259  * @param {WebInspector.MainScriptMapping} scriptMapping
    260  * @param {DebuggerAgent.Location} rawLocation
    261  * @param {function(WebInspector.UILocation)} updateDelegate
    262  */
    263 WebInspector.LiveLocation = function(scriptMapping, rawLocation, updateDelegate)
    264 {
    265     this._scriptMapping = scriptMapping;
    266     this._rawLocation = rawLocation;
    267     this._updateDelegate = updateDelegate;
    268 }
    269 
    270 WebInspector.LiveLocation.prototype = {
    271     init: function()
    272     {
    273         this._scriptMapping._registerLiveLocation(this._rawLocation.scriptId, this);
    274     },
    275 
    276     dispose: function()
    277     {
    278         this._scriptMapping._unregisterLiveLocation(this._rawLocation.scriptId, this);
    279     },
    280 
    281     _update: function()
    282     {
    283         var uiLocation = this._scriptMapping.rawLocationToUILocation(this._rawLocation);
    284         if (uiLocation)
    285             this._updateDelegate(uiLocation);
    286     }
    287 }
  • trunk/Source/WebCore/inspector/front-end/SnippetsModel.js

    r114892 r115064  
    375375        this._snippetForScriptId[script.scriptId] = snippet;
    376376        this._scriptForUISourceCode.put(uiSourceCode, script);
    377         var data = { scriptId: script.scriptId, uiSourceCodes: [uiSourceCode] };
    378         this.dispatchEventToListeners(WebInspector.ScriptMapping.Events.ScriptBound, data);
     377        script.setSourceMapping(this);
    379378    },
    380379
     
    423422        this._uiSourceCodeForScriptId[script.scriptId] = uiSourceCode;
    424423        this._scriptForUISourceCode.put(uiSourceCode, script);
    425         var data = { scriptId: script.scriptId, uiSourceCodes: [oldUISourceCode] };
    426         this.dispatchEventToListeners(WebInspector.ScriptMapping.Events.ScriptUnbound, data);
    427         data = { removedItems: [], addedItems: [uiSourceCode] };
     424        var data = { removedItems: [], addedItems: [uiSourceCode] };
    428425        this.dispatchEventToListeners(WebInspector.ScriptMapping.Events.UISourceCodeListChanged, data);
    429         data = { scriptId: script.scriptId, uiSourceCodes: [uiSourceCode] };
    430         this.dispatchEventToListeners(WebInspector.ScriptMapping.Events.ScriptBound, data);
     426        script.setSourceMapping(this);
    431427    },
    432428
Note: See TracChangeset for help on using the changeset viewer.