Changeset 83176 in webkit


Ignore:
Timestamp:
Apr 7, 2011 8:47:30 AM (13 years ago)
Author:
pfeldman@chromium.org
Message:

2011-04-06 Pavel Feldman <pfeldman@google.com>

Reviewed by Yury Semikhatsky.

Web Inspector: get rid of Breakpoint.js.
https://bugs.webkit.org/show_bug.cgi?id=57949

  • WebCore.gypi:
  • WebCore.vcproj/WebCore.vcproj:
  • inspector/front-end/Breakpoint.js: Removed.
  • inspector/front-end/BreakpointsSidebarPane.js: (WebInspector.JavaScriptBreakpointsSidebarPane.prototype.addBreakpoint): (WebInspector.JavaScriptBreakpointsSidebarPane.prototype.updateBreakpoint.didLoadSnippet): (WebInspector.JavaScriptBreakpointsSidebarPane.prototype.updateBreakpoint): (WebInspector.JavaScriptBreakpointsSidebarPane.prototype._compareBreakpoints):
  • inspector/front-end/DebuggerModel.js: (WebInspector.DebuggerModel): (WebInspector.DebuggerModel.prototype._debuggerWasDisabled): (WebInspector.DebuggerModel.prototype.setBreakpoint.didSetBreakpoint): (WebInspector.DebuggerModel.prototype.setBreakpoint): (WebInspector.DebuggerModel.prototype.setBreakpointBySourceId): (WebInspector.DebuggerModel.prototype.removeBreakpoint): (WebInspector.DebuggerModel.prototype._breakpointResolved): (WebInspector.DebuggerModel.prototype.reset):
  • inspector/front-end/DebuggerPresentationModel.js: (WebInspector.DebuggerPresentationModel): (WebInspector.DebuggerPresentationModel.prototype._refreshBreakpoints): (WebInspector.DebuggerPresentationModel.prototype._updateBreakpointsAfterLiveEdit): (WebInspector.DebuggerPresentationModel.prototype.toggleFormatSourceFiles): (WebInspector.DebuggerPresentationModel.prototype.setBreakpoint.didSetBreakpoint): (WebInspector.DebuggerPresentationModel.prototype.setBreakpoint): (WebInspector.DebuggerPresentationModel.prototype.setBreakpointEnabled): (WebInspector.DebuggerPresentationModel.prototype.updateBreakpoint): (WebInspector.DebuggerPresentationModel.prototype.removeBreakpoint): (WebInspector.DebuggerPresentationModel.prototype._breakpointAdded.didRequestSourceMapping): (WebInspector.DebuggerPresentationModel.prototype._breakpointAdded): (WebInspector.DebuggerPresentationModel.prototype._breakpointRemoved): (WebInspector.DebuggerPresentationModel.prototype._breakpointResolved): (WebInspector.DebuggerPresentationModel.prototype._restoreBreakpoints): (WebInspector.DebuggerPresentationModel.prototype._restoreBreakpoint): (WebInspector.DebuggerPresentationModel.prototype._saveBreakpoints): (WebInspector.DebuggerPresentationModel.prototype._reset): (WebInspector.PresentationBreakpoint): (WebInspector.PresentationBreakpoint.prototype.get sourceFile): (WebInspector.PresentationBreakpoint.prototype.get url): (WebInspector.PresentationBreakpoint.prototype.get resolved): (WebInspector.PresentationBreakpoint.prototype.loadSnippet):
  • inspector/front-end/ResourceTreeModel.js: (WebInspector.ResourceTreeModel): (WebInspector.ResourceTreeModel.prototype._onResourceStarted): (WebInspector.ResourceTreeModel.prototype._addResourceToFrame):
  • inspector/front-end/ScriptsPanel.js: (WebInspector.ScriptsPanel): (WebInspector.ScriptsPanel.prototype._breakpointUpdated): (WebInspector.ScriptsPanel.prototype.reset):
  • inspector/front-end/WebKit.qrc:
  • inspector/front-end/inspector.html:
Location:
trunk/Source/WebCore
Files:
1 deleted
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r83175 r83176  
     12011-04-06  Pavel Feldman  <pfeldman@google.com>
     2
     3        Reviewed by Yury Semikhatsky.
     4
     5        Web Inspector: get rid of Breakpoint.js.
     6        https://bugs.webkit.org/show_bug.cgi?id=57949
     7
     8        * WebCore.gypi:
     9        * WebCore.vcproj/WebCore.vcproj:
     10        * inspector/front-end/Breakpoint.js: Removed.
     11        * inspector/front-end/BreakpointsSidebarPane.js:
     12        (WebInspector.JavaScriptBreakpointsSidebarPane.prototype.addBreakpoint):
     13        (WebInspector.JavaScriptBreakpointsSidebarPane.prototype.updateBreakpoint.didLoadSnippet):
     14        (WebInspector.JavaScriptBreakpointsSidebarPane.prototype.updateBreakpoint):
     15        (WebInspector.JavaScriptBreakpointsSidebarPane.prototype._compareBreakpoints):
     16        * inspector/front-end/DebuggerModel.js:
     17        (WebInspector.DebuggerModel):
     18        (WebInspector.DebuggerModel.prototype._debuggerWasDisabled):
     19        (WebInspector.DebuggerModel.prototype.setBreakpoint.didSetBreakpoint):
     20        (WebInspector.DebuggerModel.prototype.setBreakpoint):
     21        (WebInspector.DebuggerModel.prototype.setBreakpointBySourceId):
     22        (WebInspector.DebuggerModel.prototype.removeBreakpoint):
     23        (WebInspector.DebuggerModel.prototype._breakpointResolved):
     24        (WebInspector.DebuggerModel.prototype.reset):
     25        * inspector/front-end/DebuggerPresentationModel.js:
     26        (WebInspector.DebuggerPresentationModel):
     27        (WebInspector.DebuggerPresentationModel.prototype._refreshBreakpoints):
     28        (WebInspector.DebuggerPresentationModel.prototype._updateBreakpointsAfterLiveEdit):
     29        (WebInspector.DebuggerPresentationModel.prototype.toggleFormatSourceFiles):
     30        (WebInspector.DebuggerPresentationModel.prototype.setBreakpoint.didSetBreakpoint):
     31        (WebInspector.DebuggerPresentationModel.prototype.setBreakpoint):
     32        (WebInspector.DebuggerPresentationModel.prototype.setBreakpointEnabled):
     33        (WebInspector.DebuggerPresentationModel.prototype.updateBreakpoint):
     34        (WebInspector.DebuggerPresentationModel.prototype.removeBreakpoint):
     35        (WebInspector.DebuggerPresentationModel.prototype._breakpointAdded.didRequestSourceMapping):
     36        (WebInspector.DebuggerPresentationModel.prototype._breakpointAdded):
     37        (WebInspector.DebuggerPresentationModel.prototype._breakpointRemoved):
     38        (WebInspector.DebuggerPresentationModel.prototype._breakpointResolved):
     39        (WebInspector.DebuggerPresentationModel.prototype._restoreBreakpoints):
     40        (WebInspector.DebuggerPresentationModel.prototype._restoreBreakpoint):
     41        (WebInspector.DebuggerPresentationModel.prototype._saveBreakpoints):
     42        (WebInspector.DebuggerPresentationModel.prototype._reset):
     43        (WebInspector.PresentationBreakpoint):
     44        (WebInspector.PresentationBreakpoint.prototype.get sourceFile):
     45        (WebInspector.PresentationBreakpoint.prototype.get url):
     46        (WebInspector.PresentationBreakpoint.prototype.get resolved):
     47        (WebInspector.PresentationBreakpoint.prototype.loadSnippet):
     48        * inspector/front-end/ResourceTreeModel.js:
     49        (WebInspector.ResourceTreeModel):
     50        (WebInspector.ResourceTreeModel.prototype._onResourceStarted):
     51        (WebInspector.ResourceTreeModel.prototype._addResourceToFrame):
     52        * inspector/front-end/ScriptsPanel.js:
     53        (WebInspector.ScriptsPanel):
     54        (WebInspector.ScriptsPanel.prototype._breakpointUpdated):
     55        (WebInspector.ScriptsPanel.prototype.reset):
     56        * inspector/front-end/WebKit.qrc:
     57        * inspector/front-end/inspector.html:
     58
    1592011-04-07  Yury Semikhatsky  <yurys@chromium.org>
    260
  • trunk/Source/WebCore/WebCore.gypi

    r83079 r83176  
    61456145            'inspector/front-end/AuditsPanel.js',
    61466146            'inspector/front-end/BottomUpProfileDataGridTree.js',
    6147             'inspector/front-end/Breakpoint.js',
    61486147            'inspector/front-end/BreakpointManager.js',
    61496148            'inspector/front-end/BreakpointsSidebarPane.js',
  • trunk/Source/WebCore/WebCore.vcproj/WebCore.vcproj

    r83113 r83176  
    6670666706                                </File>
    6670766707                                <File
    66708                                         RelativePath="..\inspector\front-end\Breakpoint.js"
    66709                                         >
    66710                                 </File>
    66711                                 <File
    6671266708                                        RelativePath="..\inspector\front-end\BreakpointManager.js"
    6671366709                                        >
  • trunk/Source/WebCore/inspector/front-end/DebuggerModel.js

    r83164 r83176  
    3232{
    3333    this._debuggerPausedDetails = {};
    34     this._breakpoints = {};
    3534    this._scripts = {};
    3635
     
    6766    _debuggerWasDisabled: function()
    6867    {
    69         this._breakpoints = {};
    7068        this.dispatchEventToListeners(WebInspector.DebuggerModel.Events.DebuggerWasDisabled);
    7169    },
     
    8987        function didSetBreakpoint(error, breakpointId, locations)
    9088        {
    91             var breakpoint;
    92             if (!error && breakpointId) {
    93                 breakpoint = new WebInspector.Breakpoint(breakpointId, url, "", lineNumber, columnNumber, condition, enabled);
    94                 breakpoint.locations = locations;
    95                 this._breakpoints[breakpointId] = breakpoint;
    96             }
    9789            if (callback)
    98                 callback(breakpoint);
     90                callback(error ? null : breakpointId, locations);
    9991        }
    10092        DebuggerAgent.setBreakpointByUrl(url, lineNumber, columnNumber, condition, enabled, didSetBreakpoint.bind(this));
     
    10597        function didSetBreakpoint(error, breakpointId, location)
    10698        {
    107             var breakpoint;
    108             if (!error && breakpointId) {
    109                 breakpoint = new WebInspector.Breakpoint(breakpointId, "", sourceID, lineNumber, columnNumber, condition, enabled);
    110                 breakpoint.locations.push(location);
    111                 this._breakpoints[breakpointId] = breakpoint;
    112             }
    11399            if (callback)
    114                 callback(breakpoint);
     100                callback(error ? null : breakpointId, [location]);
    115101        }
    116102        DebuggerAgent.setBreakpoint(sourceID, lineNumber, columnNumber, condition, enabled, didSetBreakpoint.bind(this));
     
    120106    {
    121107        DebuggerAgent.removeBreakpoint(breakpointId);
    122         delete this._breakpoints[breakpointId];
    123108    },
    124109
    125110    _breakpointResolved: function(breakpointId, location)
    126111    {
    127         var breakpoint = this._breakpoints[breakpointId];
    128         breakpoint.locations.push(location);
    129         this.dispatchEventToListeners(WebInspector.DebuggerModel.Events.BreakpointResolved, breakpoint);
    130     },
    131 
    132     get breakpoints()
    133     {
    134         return this._breakpoints;
     112        this.dispatchEventToListeners(WebInspector.DebuggerModel.Events.BreakpointResolved, {breakpointId: breakpointId, location: location});
    135113    },
    136114
     
    138116    {
    139117        this._debuggerPausedDetails = {};
    140         for (var id in this._breakpoints) {
    141             var breakpoint = this._breakpoints[id];
    142             if (!breakpoint.url)
    143                 delete this._breakpoints[id];
    144             else
    145                 breakpoint.locations = [];
    146         }
    147118        this._scripts = {};
    148119        this.dispatchEventToListeners(WebInspector.DebuggerModel.Events.Reset);
  • trunk/Source/WebCore/inspector/front-end/DebuggerPresentationModel.js

    r83053 r83176  
    3434    this._messages = [];
    3535    this._presentationBreakpoints = {};
     36    this._breakpointsWithoutSourceFile = {};
    3637    this._presentationCallFrames = [];
    3738    this._selectedCallFrameIndex = 0;
     
    4344    WebInspector.debuggerModel.addEventListener(WebInspector.DebuggerModel.Events.DebuggerPaused, this._debuggerPaused, this);
    4445    WebInspector.debuggerModel.addEventListener(WebInspector.DebuggerModel.Events.DebuggerResumed, this._debuggerResumed, this);
    45     WebInspector.debuggerModel.addEventListener(WebInspector.DebuggerModel.Events.Reset, this._reset, this);
     46    WebInspector.debuggerModel.addEventListener(WebInspector.DebuggerModel.Events.Reset, this._debuggerReset, this);
    4647}
    4748
     
    6061    _debuggerWasEnabled: function()
    6162    {
    62         this._restoreBreakpoints();
     63        this._restoreBreakpointsFromSettings();
    6364    },
    6465
     
    8182    {
    8283        this._addScript(event.data);
    83         this._refreshBreakpoints();
    8484    },
    8585
     
    8787    {
    8888        this._addScript(event.data);
    89         this._refreshBreakpoints();
    9089    },
    9190
     
    108107            sourceFile = new WebInspector.FormattedSourceFile(sourceFileId, script, contentChanged.bind(this), this._formatter);
    109108        this._sourceFiles[sourceFileId] = sourceFile;
     109
     110        this._restoreBreakpoints(sourceFile);
     111
    110112        this.dispatchEventToListeners(WebInspector.DebuggerPresentationModel.Events.SourceFileAdded, sourceFile);
    111113    },
    112114
    113     _refreshBreakpoints: function()
    114     {
    115         var breakpoints = WebInspector.debuggerModel.breakpoints;
    116         for (var id in breakpoints) {
    117             if (!(id in this._presentationBreakpoints))
    118                 this._breakpointAdded(breakpoints[id]);
    119         }
     115    _restoreBreakpoints: function(sourceFile)
     116    {
     117        var pendingBreakpoints = this._breakpointsWithoutSourceFile[sourceFile.id];
     118        for (var i = 0; pendingBreakpoints && i < pendingBreakpoints.length; ++i) {
     119            var breakpointData = pendingBreakpoints[i];
     120            if ("debuggerId" in breakpointData)
     121                this._breakpointAdded(new WebInspector.PresentationBreakpoint(sourceFile, breakpointData.lineNumber, breakpointData.condition, breakpointData.enabled, breakpointData.debuggerId));
     122            else
     123                this.setBreakpoint(sourceFile.id, breakpointData.lineNumber, breakpointData.condition, breakpointData.enabled, false);
     124        }
     125        delete this._breakpointsWithoutSourceFile[sourceFile.id];
    120126    },
    121127
     
    179185            }
    180186            if (newLineNumber !== undefined)
    181                 this.setBreakpoint(sourceFileId, newLineNumber, breakpoint.condition, breakpoint.enabled);
     187                this.setBreakpoint(sourceFileId, newLineNumber, breakpoint.condition, breakpoint.enabled, false);
    182188        }
    183189    },
     
    190196
    191197        var messages = this._messages;
    192         this._sourceFiles = {};
    193         this._messages = [];
    194         this._presentationBreakpoints = {};
    195 
     198        this._reset();
     199     
    196200        var scripts = WebInspector.debuggerModel.scripts;
    197201        for (var id in scripts)
     
    200204        for (var i = 0; i < messages.length; ++i)
    201205            this.addConsoleMessage(messages[i]);
    202 
    203         this._refreshBreakpoints();
    204206
    205207        if (WebInspector.debuggerModel.callFrames)
     
    255257    },
    256258
    257     setBreakpoint: function(sourceFileId, lineNumber, condition, enabled)
    258     {
    259         function didSetBreakpoint(breakpoint)
    260         {
    261             if (breakpoint) {
    262                 this._breakpointAdded(breakpoint);
     259    setBreakpoint: function(sourceFileId, lineNumber, condition, enabled, saveBreakpoints)
     260    {
     261        var sourceFile = this._sourceFiles[sourceFileId];
     262        if (!sourceFile)
     263            return;
     264
     265        function didSetBreakpoint(breakpointId, locations)
     266        {
     267            if (!breakpointId)
     268                return;
     269            this._breakpointAdded(new WebInspector.PresentationBreakpoint(sourceFile, lineNumber, condition, enabled, breakpointId, locations[0]));
     270
     271            if (saveBreakpoints)
    263272                this._saveBreakpoints();
    264             }
    265273        }
    266274
     
    274282                WebInspector.debuggerModel.setBreakpointBySourceId(script.sourceID, location.lineNumber, location.columnNumber, condition, enabled, didSetBreakpoint.bind(this));
    275283        }
    276         this._sourceFiles[sourceFileId].requestSourceMapping(didRequestSourceMapping.bind(this));
     284        sourceFile.requestSourceMapping(didRequestSourceMapping.bind(this));
    277285    },
    278286
     
    280288    {
    281289        var breakpoint = this.removeBreakpoint(sourceFileId, lineNumber);
    282         this.setBreakpoint(sourceFileId, lineNumber, breakpoint.condition, enabled);
     290        this.setBreakpoint(sourceFileId, lineNumber, breakpoint.condition, enabled, true);
    283291    },
    284292
     
    286294    {
    287295        this.removeBreakpoint(sourceFileId, lineNumber);
    288         this.setBreakpoint(sourceFileId, lineNumber, condition, enabled);
     296        this.setBreakpoint(sourceFileId, lineNumber, condition, enabled, true);
    289297    },
    290298
     
    292300    {
    293301        var breakpoint = this.findBreakpoint(sourceFileId, lineNumber);
    294         WebInspector.debuggerModel.removeBreakpoint(breakpoint._id);
    295         this._breakpointRemoved(breakpoint._id);
     302        WebInspector.debuggerModel.removeBreakpoint(breakpoint.debuggerId);
     303        this._breakpointRemoved(breakpoint.debuggerId);
    296304        this._saveBreakpoints();
    297305        return breakpoint;
     
    307315    _breakpointAdded: function(breakpoint)
    308316    {
    309         var script;
    310         if (breakpoint.url)
    311             script = WebInspector.debuggerModel.scriptsForURL(breakpoint.url)[0];
    312         else
    313             script = WebInspector.debuggerModel.scriptForSourceID(breakpoint.sourceID);
    314         if (!script)
     317        var sourceFile = breakpoint.sourceFile;
     318        if (!sourceFile)
    315319            return;
    316320
    317321        function didRequestSourceMapping(mapping)
    318322        {
    319             var scriptLocation = breakpoint.locations.length ? breakpoint.locations[0] : breakpoint;
    320             var sourceLocation = mapping.scriptLocationToSourceLocation(scriptLocation.lineNumber, scriptLocation.columnNumber);
    321             var lineNumber = sourceLocation.lineNumber;
    322 
    323             if (this.findBreakpoint(sourceFile.id, lineNumber)) {
     323            // Refine line number based on resolved location.
     324            if (breakpoint.location) {
     325                var sourceLocation = mapping.scriptLocationToSourceLocation(breakpoint.location.lineNumber, breakpoint.location.columnNumber);
     326                breakpoint.lineNumber = sourceLocation.lineNumber;
     327            }
     328
     329            if (this.findBreakpoint(sourceFile.id, breakpoint.lineNumber)) {
    324330                // We can't show more than one breakpoint on a single source file line.
    325                 WebInspector.debuggerModel.removeBreakpoint(breakpoint.id);
     331                WebInspector.debuggerModel.removeBreakpoint(breakpoint.debuggerId);
    326332                return;
    327333            }
    328 
    329             var presentationBreakpoint = new WebInspector.PresentationBreakpoint(breakpoint, sourceFile, lineNumber);
    330             presentationBreakpoint._id = breakpoint.id;
    331             this._presentationBreakpoints[breakpoint.id] = presentationBreakpoint;
    332             sourceFile.breakpoints[lineNumber] = presentationBreakpoint;
    333             this.dispatchEventToListeners(WebInspector.DebuggerPresentationModel.Events.BreakpointAdded, presentationBreakpoint);
    334         }
    335         var sourceFile = this._sourceFileForScript(script);
     334            this._presentationBreakpoints[breakpoint.debuggerId] = breakpoint;
     335            sourceFile.breakpoints[breakpoint.lineNumber] = breakpoint;
     336            this.dispatchEventToListeners(WebInspector.DebuggerPresentationModel.Events.BreakpointAdded, breakpoint);
     337        }
    336338        sourceFile.requestSourceMapping(didRequestSourceMapping.bind(this));
    337339    },
    338340
    339     _breakpointRemoved: function(breakpointId)
    340     {
    341         var breakpoint = this._presentationBreakpoints[breakpointId];
    342         delete this._presentationBreakpoints[breakpointId];
     341    _breakpointRemoved: function(debuggerId)
     342    {
     343        var breakpoint = this._presentationBreakpoints[debuggerId];
     344        if (!breakpoint)
     345            return;
     346        delete this._presentationBreakpoints[debuggerId];
    343347        var sourceFile = this.sourceFile(breakpoint.sourceFileId);
    344348        delete sourceFile.breakpoints[breakpoint.lineNumber];
     
    348352    _breakpointResolved: function(event)
    349353    {
    350         var breakpoint = event.data;
    351         if (!(breakpoint.id in this._presentationBreakpoints))
    352             return;
    353         this._breakpointRemoved(breakpoint.id);
     354        var debuggerId = event.data.breakpointId;
     355        if (!(debuggerId in this._presentationBreakpoints))
     356            return;
     357        var breakpoint = this._presentationBreakpoints[debuggerId];
     358        this._breakpointRemoved(debuggerId);
    354359        this._breakpointAdded(breakpoint);
    355360    },
    356361
    357     _restoreBreakpoints: function()
    358     {
    359         function didSetBreakpoint(breakpoint)
    360         {
    361             if (breakpoint)
    362                 this._breakpointAdded(breakpoint);
    363         }
     362    _restoreBreakpointsFromSettings: function()
     363    {
    364364        var breakpoints = WebInspector.settings.breakpoints;
    365365        for (var i = 0; i < breakpoints.length; ++i) {
    366             var breakpoint = breakpoints[i];
    367             WebInspector.debuggerModel.setBreakpoint(breakpoint.url, breakpoint.lineNumber, breakpoint.columnNumber, breakpoint.condition, breakpoint.enabled, didSetBreakpoint.bind(this));
     366            var breakpointData = breakpoints[i];
     367            var sourceFileId = breakpointData.sourceFileId;
     368            if (!sourceFileId)
     369                continue;
     370            var sourceFile = this._sourceFiles[sourceFileId];
     371            if (sourceFile) {
     372                this.setBreakpoint(sourceFileId, breakpointData.lineNumber, breakpointData.condition, breakpointData.enabled, false);
     373                continue;
     374            }
     375
     376            // Add breakpoint once source file becomes available.
     377            var pendingBreakpoints = this._breakpointsWithoutSourceFile[sourceFileId];
     378            if (!pendingBreakpoints) {
     379                pendingBreakpoints = [];
     380                this._breakpointsWithoutSourceFile[sourceFileId] = pendingBreakpoints;
     381            }
     382            pendingBreakpoints.push(breakpointData);
    368383        }
    369384    },
     
    372387    {
    373388        var serializedBreakpoints = [];
    374         var breakpoints = WebInspector.debuggerModel.breakpoints;
    375         for (var id in breakpoints) {
    376             var breakpoint = breakpoints[id];
    377             if (!breakpoint.url)
    378                 continue;
    379             var serializedBreakpoint = {};
    380             serializedBreakpoint.url = breakpoint.url;
    381             serializedBreakpoint.lineNumber = breakpoint.lineNumber;
    382             serializedBreakpoint.columnNumber = breakpoint.columnNumber;
    383             serializedBreakpoint.condition = breakpoint.condition;
    384             serializedBreakpoint.enabled = breakpoint.enabled;
    385             serializedBreakpoints.push(serializedBreakpoint);
    386         }
     389
     390        // Store active breakpoints.
     391        for (var id in this._presentationBreakpoints) {
     392            var breakpoint = this._presentationBreakpoints[id];
     393            if (breakpoint.sourceFile && breakpoint.sourceFile.url)
     394                serializedBreakpoints.push(breakpoint.serialize());
     395        }
     396
     397        // Store inactive breakpoints.
     398        for (var sourceFileId in this._breakpointsWithoutSourceFile)
     399            serializedBreakpoints = serializedBreakpoints.concat(this._breakpointsWithoutSourceFile[sourceFileId]);
     400
     401        // Sanitize debugger ids.
     402        for (var i = 0; i < serializedBreakpoints.length; ++i)
     403            delete serializedBreakpoints[i].debuggerId;
     404
    387405        WebInspector.settings.breakpoints = serializedBreakpoints;
    388406    },
     
    446464    _reset: function()
    447465    {
     466        for (var id in this._sourceFiles) {
     467            var sourceFile = this._sourceFiles[id];
     468            for (var line in sourceFile.breakpoints) {
     469                var breakpoints = this._breakpointsWithoutSourceFile[sourceFile.id];
     470                if (!breakpoints) {
     471                    breakpoints = [];
     472                    this._breakpointsWithoutSourceFile[sourceFile.id] = breakpoints;
     473                }
     474                breakpoints.push(sourceFile.breakpoints[line].serialize());
     475            }
     476        }
     477
    448478        this._sourceFiles = {};
    449479        this._messages = [];
    450480        this._presentationBreakpoints = {};
     481    },
     482
     483    _debuggerReset: function()
     484    {
     485        this._reset();
    451486        this._presentationCallFrames = [];
    452487        this._selectedCallFrameIndex = 0;
     
    456491WebInspector.DebuggerPresentationModel.prototype.__proto__ = WebInspector.Object.prototype;
    457492
    458 WebInspector.PresentationBreakpoint = function(breakpoint, sourceFile, lineNumber)
     493WebInspector.PresentationBreakpoint = function(sourceFile, lineNumber, condition, enabled, debuggerId, location)
    459494{
    460     this._breakpoint = breakpoint;
    461     this._sourceFile = sourceFile;
    462     this._lineNumber = lineNumber;
     495    this.sourceFile = sourceFile;
     496    this.sourceFileId = sourceFile.id;
     497    this.lineNumber = lineNumber;
     498    this.condition = condition;
     499    this.enabled = enabled;
     500    this.debuggerId = debuggerId;
     501    this.location = location;
    463502}
    464503
    465504WebInspector.PresentationBreakpoint.prototype = {
    466     get sourceFileId()
    467     {
    468         return this._sourceFile.id;
    469     },
    470 
    471     get lineNumber()
    472     {
    473         return this._lineNumber;
    474     },
    475 
    476     get condition()
    477     {
    478         return this._breakpoint.condition;
    479     },
    480 
    481     get enabled()
    482     {
    483         return this._breakpoint.enabled;
    484     },
    485 
    486505    get url()
    487506    {
    488         return this._sourceFile.url;
     507        return this.sourceFile.url;
    489508    },
    490509
    491510    get resolved()
    492511    {
    493         return !!this._breakpoint.locations.length
     512        return !!this.location;
    494513    },
    495514
     
    504523            callback(snippet);
    505524        }
    506         this._sourceFile.requestContent(didRequestContent.bind(this));
     525        if (!this.sourceFile) {
     526            callback(WebInspector.UIString("N/A"));
     527            return;
     528        }
     529        this.sourceFile.requestContent(didRequestContent.bind(this));
     530    },
     531
     532    serialize: function()
     533    {
     534        var serializedBreakpoint = {};
     535        serializedBreakpoint.sourceFileId = this.sourceFile.id;
     536        serializedBreakpoint.lineNumber = this.lineNumber;
     537        serializedBreakpoint.condition = this.condition;
     538        serializedBreakpoint.enabled = this.enabled;
     539        serializedBreakpoint.debuggerId = this.debuggerId;
     540        return serializedBreakpoint;
    507541    }
    508542}
  • trunk/Source/WebCore/inspector/front-end/ResourceTreeModel.js

    r82107 r83176  
    3232WebInspector.ResourceTreeModel = function(networkManager)
    3333{
     34    WebInspector.networkManager.addEventListener(WebInspector.NetworkManager.EventTypes.ResourceStarted, this._onResourceStarted, this);
     35    WebInspector.networkManager.addEventListener(WebInspector.NetworkManager.EventTypes.ResourceUpdated, this._onResourceUpdated, this);
    3436    WebInspector.networkManager.addEventListener(WebInspector.NetworkManager.EventTypes.ResourceFinished, this._onResourceUpdated, this);
    35     WebInspector.networkManager.addEventListener(WebInspector.NetworkManager.EventTypes.ResourceUpdated, this._onResourceUpdated, this);
    3637    WebInspector.networkManager.addEventListener(WebInspector.NetworkManager.EventTypes.FrameDetached, this._onFrameDetachedFromParent, this);
    3738    WebInspector.networkManager.addEventListener(WebInspector.NetworkManager.EventTypes.FrameCommittedLoad, this._onCommitLoad, this);
     
    130131        this._clearChildFramesAndResources(frameId, 0);
    131132        this.dispatchEventToListeners(WebInspector.ResourceTreeModel.EventTypes.FrameDetached, frameId);
     133    },
     134
     135    _onResourceStarted: function(event)
     136    {
     137        if (!this._cachedResourcesProcessed)
     138            return;
     139        this._bindResourceURL(event.data);
    132140    },
    133141
  • trunk/Source/WebCore/inspector/front-end/WebKit.qrc

    r82668 r83176  
    1010    <file>AuditsPanel.js</file>
    1111    <file>BottomUpProfileDataGridTree.js</file>
    12     <file>Breakpoint.js</file>
    1312    <file>BreakpointManager.js</file>
    1413    <file>BreakpointsSidebarPane.js</file>
  • trunk/Source/WebCore/inspector/front-end/inspector.html

    r82668 r83176  
    7474    <script type="text/javascript" src="ApplicationCacheItemsView.js"></script>
    7575    <script type="text/javascript" src="Script.js"></script>
    76     <script type="text/javascript" src="Breakpoint.js"></script>
    7776    <script type="text/javascript" src="BreakpointManager.js"></script>
    7877    <script type="text/javascript" src="SidebarPane.js"></script>
Note: See TracChangeset for help on using the changeset viewer.