Changeset 120335 in webkit


Ignore:
Timestamp:
Jun 14, 2012 9:57:15 AM (12 years ago)
Author:
vsevik@chromium.org
Message:

Web Inspector: DebuggerModel should support setting breakpoints without script by sourceURL only.
https://bugs.webkit.org/show_bug.cgi?id=88988

Reviewed by Pavel Feldman.

This change allows setting all saved breakpoints in debugger model by url before the site
with corresponding scripts was loaded (allows breaking in onload handler on first load).
This change also simplifies implementation of snippets debugging.

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

(WebInspector.DebuggerModel.prototype.setBreakpointByScriptLocation):

Location:
trunk/Source/WebCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r120331 r120335  
     12012-06-14  Vsevolod Vlasov  <vsevik@chromium.org>
     2
     3        Web Inspector: DebuggerModel should support setting breakpoints without script by sourceURL only.
     4        https://bugs.webkit.org/show_bug.cgi?id=88988
     5
     6        Reviewed by Pavel Feldman.
     7
     8        This change allows setting all saved breakpoints in debugger model by url before the site
     9        with corresponding scripts was loaded (allows breaking in onload handler on first load).
     10        This change also simplifies implementation of snippets debugging.
     11
     12        * inspector/front-end/BreakpointManager.js:
     13        * inspector/front-end/DebuggerModel.js:
     14        (WebInspector.DebuggerModel.prototype.setBreakpointByScriptLocation):
     15
    1162012-06-14  Pavel Feldman  <pfeldman@chromium.org>
    217
  • trunk/Source/WebCore/inspector/front-end/BreakpointManager.js

    r120223 r120335  
    376376        var rawLocation = this._primaryUILocation.uiLocationToRawLocation();
    377377        var debuggerModelLocation = /** @type {WebInspector.DebuggerModel.Location} */ rawLocation;
    378         this._breakpointManager._debuggerModel.setBreakpointByScriptLocation(debuggerModelLocation, this._condition, didSetBreakpoint.bind(this));
     378        if (debuggerModelLocation)
     379            this._breakpointManager._debuggerModel.setBreakpointByScriptLocation(debuggerModelLocation, this._condition, didSetBreakpoint.bind(this));
     380        else
     381            this._breakpointManager._debuggerModel.setBreakpointByURL(this._primaryUILocation.uiSourceCode.url, this._primaryUILocation.lineNumber, 0, this._condition, didSetBreakpoint.bind(this));
     382       
    379383        /**
    380384         * @this {WebInspector.BreakpointManager.Breakpoint}
  • trunk/Source/WebCore/inspector/front-end/DebuggerModel.js

    r119898 r120335  
    136136        var script = this.scriptForId(rawLocation.scriptId);
    137137        if (script.sourceURL)
    138             this.setBreakpoint(script.sourceURL, rawLocation.lineNumber, rawLocation.columnNumber, condition, callback);
     138            this.setBreakpointByURL(script.sourceURL, rawLocation.lineNumber, rawLocation.columnNumber, condition, callback);
    139139        else
    140140            this.setBreakpointBySourceId(rawLocation, condition, callback);
     
    148148     * @param {function(?DebuggerAgent.BreakpointId, Array.<WebInspector.DebuggerModel.Location>)=} callback
    149149     */
    150     setBreakpoint: function(url, lineNumber, columnNumber, condition, callback)
     150    setBreakpointByURL: function(url, lineNumber, columnNumber, condition, callback)
    151151    {
    152152        // Adjust column if needed.
Note: See TracChangeset for help on using the changeset viewer.