Changeset 95538 in webkit


Ignore:
Timestamp:
Sep 20, 2011 7:00:37 AM (13 years ago)
Author:
pfeldman@chromium.org
Message:

Web Inspector: document Debugger.paused, introduce types for ids in Debugger domain.
https://bugs.webkit.org/show_bug.cgi?id=68363

Migrates from poorly documented "details" object to explicit parameters
containing break type and data.

Reviewed by Tony Gentilcore.

Source/WebCore:

  • inspector/InjectedScriptSource.js:

():

  • inspector/Inspector.json:
  • inspector/InspectorDOMDebuggerAgent.cpp:

(WebCore::InspectorDOMDebuggerAgent::didInvalidateStyleAttr):
(WebCore::InspectorDOMDebuggerAgent::willInsertDOMNode):
(WebCore::InspectorDOMDebuggerAgent::willRemoveDOMNode):
(WebCore::InspectorDOMDebuggerAgent::willModifyDOMAttr):
(WebCore::InspectorDOMDebuggerAgent::pauseOnNativeEventIfNeeded):
(WebCore::InspectorDOMDebuggerAgent::willSendXMLHttpRequest):

  • inspector/InspectorDebuggerAgent.cpp:

(WebCore::InspectorDebuggerAgent::InspectorDebuggerAgent):
(WebCore::InspectorDebuggerAgent::schedulePauseOnNextStatement):
(WebCore::InspectorDebuggerAgent::cancelPauseOnNextStatement):
(WebCore::InspectorDebuggerAgent::pause):
(WebCore::InspectorDebuggerAgent::didPause):
(WebCore::InspectorDebuggerAgent::didContinue):
(WebCore::InspectorDebuggerAgent::breakProgram):
(WebCore::InspectorDebuggerAgent::clear):
(WebCore::InspectorDebuggerAgent::clearBreakDetails):

  • inspector/InspectorDebuggerAgent.h:
  • inspector/front-end/DOMBreakpointsSidebarPane.js:

(WebInspector.DOMBreakpointsSidebarPane.prototype.createBreakpointHitStatusMessage.didPushNodeToFrontend):
(WebInspector.DOMBreakpointsSidebarPane.prototype.createBreakpointHitStatusMessage):
(WebInspector.DOMBreakpointsSidebarPane.prototype.highlightBreakpoint):

  • inspector/front-end/DebuggerModel.js:

(WebInspector.DebuggerModel.prototype._pausedScript):
(WebInspector.DebuggerDispatcher.prototype.paused):

  • inspector/front-end/DebuggerPresentationModel.js:

(WebInspector.PresentationCallFrame.prototype.evaluate):

  • inspector/front-end/ScopeChainSidebarPane.js:

(WebInspector.ScopeChainSidebarPane.prototype.update):

  • inspector/front-end/ScriptsPanel.js:

(WebInspector.ScriptsPanel.prototype._debuggerPaused.didCreateBreakpointHitStatusMessage):
(WebInspector.ScriptsPanel.prototype._debuggerPaused.else.didGetSourceLocation):
(WebInspector.ScriptsPanel.prototype._debuggerPaused):

LayoutTests:

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

(initialize_DebuggerTest):

Location:
trunk
Files:
13 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r95536 r95538  
     12011-09-19  Pavel Feldman  <pfeldman@google.com>
     2
     3        Web Inspector: document Debugger.paused, introduce types for ids in Debugger domain.
     4        https://bugs.webkit.org/show_bug.cgi?id=68363
     5
     6        Migrates from poorly documented "details" object to explicit parameters
     7        containing break type and data.
     8
     9        Reviewed by Tony Gentilcore.
     10
     11        * http/tests/inspector/debugger-test.js:
     12        (initialize_DebuggerTest):
     13
    1142011-09-15  Pavel Feldman  <pfeldman@google.com>
    215
  • trunk/LayoutTests/http/tests/inspector/debugger-test.js

    r92958 r95538  
    132132};
    133133
    134 InspectorTest._pausedScript = function(details)
     134InspectorTest._pausedScript = function(callFrames, reason, auxData)
    135135{
    136136    if (!InspectorTest._quiet)
    137137        InspectorTest.addResult("Script execution paused.");
    138     InspectorTest._callFrames = details.callFrames;
     138    InspectorTest._callFrames = callFrames;
    139139    if (InspectorTest._waitUntilPausedCallback) {
    140140        var callback = InspectorTest._waitUntilPausedCallback;
  • trunk/Source/WebCore/ChangeLog

    r95536 r95538  
     12011-09-19  Pavel Feldman  <pfeldman@google.com>
     2
     3        Web Inspector: document Debugger.paused, introduce types for ids in Debugger domain.
     4        https://bugs.webkit.org/show_bug.cgi?id=68363
     5
     6        Migrates from poorly documented "details" object to explicit parameters
     7        containing break type and data.
     8
     9        Reviewed by Tony Gentilcore.
     10
     11        * inspector/InjectedScriptSource.js:
     12        ():
     13        * inspector/Inspector.json:
     14        * inspector/InspectorDOMDebuggerAgent.cpp:
     15        (WebCore::InspectorDOMDebuggerAgent::didInvalidateStyleAttr):
     16        (WebCore::InspectorDOMDebuggerAgent::willInsertDOMNode):
     17        (WebCore::InspectorDOMDebuggerAgent::willRemoveDOMNode):
     18        (WebCore::InspectorDOMDebuggerAgent::willModifyDOMAttr):
     19        (WebCore::InspectorDOMDebuggerAgent::pauseOnNativeEventIfNeeded):
     20        (WebCore::InspectorDOMDebuggerAgent::willSendXMLHttpRequest):
     21        * inspector/InspectorDebuggerAgent.cpp:
     22        (WebCore::InspectorDebuggerAgent::InspectorDebuggerAgent):
     23        (WebCore::InspectorDebuggerAgent::schedulePauseOnNextStatement):
     24        (WebCore::InspectorDebuggerAgent::cancelPauseOnNextStatement):
     25        (WebCore::InspectorDebuggerAgent::pause):
     26        (WebCore::InspectorDebuggerAgent::didPause):
     27        (WebCore::InspectorDebuggerAgent::didContinue):
     28        (WebCore::InspectorDebuggerAgent::breakProgram):
     29        (WebCore::InspectorDebuggerAgent::clear):
     30        (WebCore::InspectorDebuggerAgent::clearBreakDetails):
     31        * inspector/InspectorDebuggerAgent.h:
     32        * inspector/front-end/DOMBreakpointsSidebarPane.js:
     33        (WebInspector.DOMBreakpointsSidebarPane.prototype.createBreakpointHitStatusMessage.didPushNodeToFrontend):
     34        (WebInspector.DOMBreakpointsSidebarPane.prototype.createBreakpointHitStatusMessage):
     35        (WebInspector.DOMBreakpointsSidebarPane.prototype.highlightBreakpoint):
     36        * inspector/front-end/DebuggerModel.js:
     37        (WebInspector.DebuggerModel.prototype._pausedScript):
     38        (WebInspector.DebuggerDispatcher.prototype.paused):
     39        * inspector/front-end/DebuggerPresentationModel.js:
     40        (WebInspector.PresentationCallFrame.prototype.evaluate):
     41        * inspector/front-end/ScopeChainSidebarPane.js:
     42        (WebInspector.ScopeChainSidebarPane.prototype.update):
     43        * inspector/front-end/ScriptsPanel.js:
     44        (WebInspector.ScriptsPanel.prototype._debuggerPaused.didCreateBreakpointHitStatusMessage):
     45        (WebInspector.ScriptsPanel.prototype._debuggerPaused.else.didGetSourceLocation):
     46        (WebInspector.ScriptsPanel.prototype._debuggerPaused):
     47
     482011-09-19  Pavel Feldman  <pfeldman@google.com>
     49
     50        Web Inspector: use strict types for Breakpoint and CallFrame ids in the protocol definition.
     51        https://bugs.webkit.org/show_bug.cgi?id=68172
     52
     53        Reviewed by Tony Gentilcore.
     54
     55        * inspector/Inspector.json:
     56
    1572011-09-15  Pavel Feldman  <pfeldman@google.com>
    258
  • trunk/Source/WebCore/inspector/InjectedScriptSource.js

    r94958 r95538  
    489489InjectedScript.CallFrameProxy = function(ordinal, callFrame)
    490490{
    491     this.id = "{\"ordinal\":" + ordinal + ",\"injectedScriptId\":" + injectedScriptId + "}";
     491    this.callFrameId = "{\"ordinal\":" + ordinal + ",\"injectedScriptId\":" + injectedScriptId + "}";
    492492    this.functionName = (callFrame.type === "function" ? callFrame.functionName : "");
    493493    this.location = { scriptId: String(callFrame.sourceID), lineNumber: callFrame.line, columnNumber: callFrame.column };
  • trunk/Source/WebCore/inspector/Inspector.json

    r95535 r95538  
    255255                    { "name": "name", "type": "string", "description": "Property name." },
    256256                    { "name": "value", "$ref": "RemoteObject", "optional": true, "description": "The value associated with the property." },
    257                     { "name": "writable", "type": "boolean", "description": "True iff the value associated with the property may be changed (data descriptors only)." },
     257                    { "name": "writable", "type": "boolean", "description": "True if the value associated with the property may be changed (data descriptors only)." },
    258258                    { "name": "get", "$ref": "RemoteObject", "optional": true, "description": "A function which serves as a getter for the property, or <code>undefined</code> if there is no getter (accessor descriptors only)." },
    259259                    { "name": "set", "$ref": "RemoteObject", "optional": true, "description": "A function which serves as a setter for the property, or <code>undefined</code> if there is no setter (accessor descriptors only)." },
    260                     { "name": "configurable", "type": "boolean", "description": "True iff the type of this property descriptor may be changed and if the property may be deleted from the corresponding object." },
    261                     { "name": "enumerable", "type": "boolean", "description": "True iff this property shows up during enumeration of the properties on the corresponding object." },
    262                     { "name": "wasThrown", "type": "boolean", "optional": true, "description": "True iff the result was thrown during the evaluation." }
     260                    { "name": "configurable", "type": "boolean", "description": "True if the type of this property descriptor may be changed and if the property may be deleted from the corresponding object." },
     261                    { "name": "enumerable", "type": "boolean", "description": "True if this property shows up during enumeration of the properties on the corresponding object." },
     262                    { "name": "wasThrown", "type": "boolean", "optional": true, "description": "True if the result was thrown during the evaluation." }
    263263                ]
    264264            },
     
    279279                    { "name": "expression", "type": "string", "description": "Expression to evaluate." },
    280280                    { "name": "objectGroup", "type": "string", "optional": true, "description": "Symbolic group name that can be used to release multiple objects." },
    281                     { "name": "includeCommandLineAPI", "type": "boolean", "optional": true, "description": "Determines whether Command Line API should be available during the evaluation." },
    282                     { "name": "doNotPauseOnExceptions", "type": "boolean", "optional": true, "description": "Specifies whether evaluation should stop on exceptions. Overrides setPauseOnException state." },
     281                    { "name": "includeCommandLineAPI", "type": "boolean", "optional": true, "description": "Determines whether Command Line API should be available during the evaluation.", "hidden": true },
     282                    { "name": "doNotPauseOnExceptions", "type": "boolean", "optional": true, "description": "Specifies whether evaluation should stop on exceptions. Overrides setPauseOnException state.", "hidden": true },
    283283                    { "name": "frameId", "type": "string", "optional": true, "description": "Specifies in which frame to perform evaluation.", "hidden": true },
    284284                    { "name": "returnByValue", "type": "boolean", "optional": true, "description": "Whether the result is expected to be a JSON object that should be sent by value." }
     
    286286                "returns": [
    287287                    { "name": "result", "$ref": "RemoteObject", "description": "Evaluation result." },
    288                     { "name": "wasThrown", "type": "boolean", "optional": true, "description": "True iff the result was thrown during the evaluation." }
     288                    { "name": "wasThrown", "type": "boolean", "optional": true, "description": "True if the result was thrown during the evaluation." }
    289289                ],
    290290                "description": "Evaluates expression on global object."
     
    300300                "returns": [
    301301                    { "name": "result", "$ref": "RemoteObject", "description": "Call result." },
    302                     { "name": "wasThrown", "type": "boolean", "optional": true, "description": "True iff the result was thrown during the evaluation." }
     302                    { "name": "wasThrown", "type": "boolean", "optional": true, "description": "True if the result was thrown during the evaluation." }
    303303                ],
    304304                "description": "Calls function with given declaration on the given object."
     
    15201520    {
    15211521        "domain": "Debugger",
    1522         "description": "Debugger domain exposes JavaScript debugging functions. It allows setting and removing breakpoints, stepping through execution, exploring stack traces, etc.",
     1522        "description": "Debugger domain exposes JavaScript debugging capabilities. It allows setting and removing breakpoints, stepping through execution, exploring stack traces, etc.",
    15231523        "types": [
     1524            {
     1525                "id": "BreakpointId",
     1526                "type": "string",
     1527                "description": "Breakpoint identifier."
     1528            },
    15241529            {
    15251530                "id": "ScriptId",
     
    15281533            },
    15291534            {
     1535                "id": "CallFrameId",
     1536                "type": "string",
     1537                "description": "Call frame identifier."
     1538            },
     1539            {
    15301540                "id": "Location",
    15311541                "type": "object",
     
    15411551                "type": "object",
    15421552                "properties": [
    1543                     { "name": "id", "type": "string", "description": "Call frame identifier. This identifier is only valid while the virtual machine is paused." },
     1553                    { "name": "callFrameId", "$ref": "CallFrameId", "description": "Call frame identifier. This identifier is only valid while the virtual machine is paused." },
    15441554                    { "name": "functionName", "type": "string", "description": "Name of the JavaScript function called on this call frame." },
    15451555                    { "name": "location", "$ref": "Location", "description": "Location in the source code." },
     
    15851595                ],
    15861596                "returns": [
    1587                     { "name": "breakpointId", "type": "string", "description": "Id of the created breakpoint for further reference." },
     1597                    { "name": "breakpointId", "$ref": "BreakpointId", "description": "Id of the created breakpoint for further reference." },
    15881598                    { "name": "locations", "optional": true, "type": "array", "items": { "$ref": "Location"}, "description": "List of the locations this breakpoint resolved into upon addition." }
    15891599                ],
    1590                 "description": "Sets JavaScript breakpoint at given location specified either by URL or URL regex. Once this command is issued, all existing parsed scripts will have breakpoints resolved and returned in <code>locations</code> property. Further matching script parsing will result in subsequent <code>Debugger.breakpointResolved</code> events issued. This logical breakpoint will survive page reloads."
     1600                "description": "Sets JavaScript breakpoint at given location specified either by URL or URL regex. Once this command is issued, all existing parsed scripts will have breakpoints resolved and returned in <code>locations</code> property. Further matching script parsing will result in subsequent <code>breakpointResolved</code> events issued. This logical breakpoint will survive page reloads."
    15911601            },
    15921602            {
     
    15971607                ],
    15981608                "returns": [
    1599                     { "name": "breakpointId", "type": "string", "description": "Id of the created breakpoint for further manipulations." },
     1609                    { "name": "breakpointId", "$ref": "BreakpointId", "description": "Id of the created breakpoint for further reference." },
    16001610                    { "name": "actualLocation", "$ref": "Location", "description": "Location this breakpoint resolved into." }
    16011611                ],
     
    16051615                "name": "removeBreakpoint",
    16061616                "parameters": [
    1607                     { "name": "breakpointId", "type": "string" }
     1617                    { "name": "breakpointId", "$ref": "BreakpointId" }
    16081618                ],
    16091619                "description": "Removes JavaScript breakpoint."
     
    16221632            {
    16231633                "name": "stepInto",
    1624                 "description": "Steps into the statement."
     1634                "description": "Steps into the function call."
    16251635            },
    16261636            {
    16271637                "name": "stepOut",
    1628                 "description": "Steps out of the function."
     1638                "description": "Steps out of the function call."
    16291639            },
    16301640            {
     
    16411651                    { "name": "scriptId", "$ref": "ScriptId", "description": "Id of the script to edit." },
    16421652                    { "name": "scriptSource", "type": "string", "description": "New content of the script." },
    1643                     { "name": "preview", "type": "boolean", "optional": true, "description": " If true the change will not actually be applied. Preview mode may be used to get result description without actually modifying the code." }
     1653                    { "name": "preview", "type": "boolean", "optional": true, "description": " If true the change will not actually be applied. Preview mode may be used to get result description without actually modifying the code.", "hidden": true }
    16441654                ],
    16451655                "returns": [
    16461656                    { "name": "callFrames", "type": "array", "optional": true, "items": { "$ref": "CallFrame"}, "description": "New stack trace in case editing has happened while VM was stopped." },
    1647                     { "name": "result", "type": "object", "optional": true, "description": "VM-specific description of the changes applied." }
     1657                    { "name": "result", "type": "object", "optional": true, "description": "VM-specific description of the changes applied.", "hidden": true }
    16481658                ],
    16491659                "description": "Edits JavaScript source live."
     
    16571667                    { "name": "scriptSource", "type": "string", "description": "Script source." }
    16581668                ],
    1659                 "description": "Returns source for the script with given ID."
     1669                "description": "Returns source for the script with given id."
    16601670            },
    16611671            {
     
    16641674                    { "name": "state", "type": "string", "enum": ["none", "uncaught", "all"], "description": "Pause on exceptions mode." }
    16651675                ],
    1666                 "description": "Defines pause on exceptions state. Can be set to stop on all exceptions, uncaught exceptions or no exceptions."
     1676                "description": "Defines pause on exceptions state. Can be set to stop on all exceptions, uncaught exceptions or no exceptions. Initial pause on exceptions state is <code>none</code>."
    16671677            },
    16681678            {
    16691679                "name": "evaluateOnCallFrame",
    16701680                "parameters": [
    1671                     { "name": "callFrameId", "type": "string", "description": "Call frame identifier to evaluate on. This identifier is a part of backtrace reported by the <code>pausedScript</code>." },
     1681                    { "name": "callFrameId", "$ref": "CallFrameId", "description": "Call frame identifier to evaluate on." },
    16721682                    { "name": "expression", "type": "string", "description": "Expression to evaluate." },
    16731683                    { "name": "objectGroup", "type": "string", "optional": true, "description": "String object group name to put result into (allows rapid releasing resulting object handles using <code>releaseObjectGroup</code>)." },
    1674                     { "name": "includeCommandLineAPI", "type": "boolean", "optional": true, "description": "Specifies whether command line API should be available to the evaluated expression, defaults to false." },
     1684                    { "name": "includeCommandLineAPI", "type": "boolean", "optional": true, "description": "Specifies whether command line API should be available to the evaluated expression, defaults to false.", "hidden": true },
    16751685                    { "name": "returnByValue", "type": "boolean", "optional": true, "description": "Whether the result is expected to be a JSON object that should be sent by value." }
    16761686                ],
    16771687                "returns": [
    16781688                    { "name": "result", "$ref": "Runtime.RemoteObject", "description": "Object wrapper for the evaluation result." },
    1679                     { "name": "wasThrown", "type": "boolean", "optional": true, "description": "True iff the result was thrown during the evaluation." }
     1689                    { "name": "wasThrown", "type": "boolean", "optional": true, "description": "True if the result was thrown during the evaluation." }
    16801690                ],
    16811691                "description": "Evaluates expression on a given call frame."
     
    16851695            {
    16861696                "name": "debuggerWasEnabled",
    1687                 "description": "Fired when debugger gets enabled (deprecated)."
     1697                "description": "Fired when debugger gets enabled (deprecated).",
     1698                "hidden": true
    16881699            },
    16891700            {
    16901701                "name": "debuggerWasDisabled",
    1691                 "description": "Fired when debugger gets disabled (deprecated)."
     1702                "description": "Fired when debugger gets disabled (deprecated).",
     1703                "hidden": true
    16921704            },
    16931705            {
     
    16951707                "parameters": [
    16961708                    { "name": "scriptId", "$ref": "ScriptId", "description": "Identifier of the script parsed." },
    1697                     { "name": "url", "type": "string", "description": "URL of the script parsed (if any)." },
     1709                    { "name": "url", "type": "string", "description": "URL or name of the script parsed (if any)." },
    16981710                    { "name": "startLine", "type": "integer", "description": "Line offset of the script within the resource with given URL (for script tags)." },
    16991711                    { "name": "startColumn", "type": "integer", "description": "Column offset of the script within the resource with given URL." },
     
    17021714                    { "name": "isContentScript", "type": "boolean", "optional": true, "description": "Determines whether this script is a user extension script." }
    17031715                ],
    1704                 "description": "Fired when virtual machine parses script. This even is also fired for all known scripts upon enabling debugger."
     1716                "description": "Fired when virtual machine parses script. This event is also fired for all known and uncollected scripts upon enabling debugger."
    17051717            },
    17061718            {
     
    17081720                "parameters": [
    17091721                    { "name": "url", "type": "string", "description": "URL of the script that failed to parse." },
    1710                     { "name": "data", "type": "string", "description": "Source text of the script that failed to parse." },
    1711                     { "name": "firstLine", "type": "integer", "description": "Line offset of the script within the resource." },
     1722                    { "name": "scriptSource", "type": "string", "description": "Source text of the script that failed to parse." },
     1723                    { "name": "startLine", "type": "integer", "description": "Line offset of the script within the resource." },
    17121724                    { "name": "errorLine", "type": "integer", "description": "Line with error." },
    17131725                    { "name": "errorMessage", "type": "string", "description": "Parse error message." }
     
    17181730                "name": "breakpointResolved",
    17191731                "parameters": [
    1720                     { "name": "breakpointId", "type": "string", "description": "Breakpoint unique identifier." },
     1732                    { "name": "breakpointId", "$ref": "BreakpointId", "description": "Breakpoint unique identifier." },
    17211733                    { "name": "location", "$ref": "Location", "description": "Actual breakpoint location." }
    17221734                ],
     
    17261738                "name": "paused",
    17271739                "parameters": [
    1728                     {
    1729                         "name": "details",
    1730                         "type": "object",
    1731                         "properties": [
    1732                             { "name": "callFrames", "type": "array", "items": { "$ref": "CallFrame" }, "description": "Call stack the virtual machine stopped on." },
    1733                             { "name": "exception", "$ref": "Runtime.RemoteObject", "optional": true, "description": "Current exception object if script execution is paused when an exception is being thrown." }
    1734                         ],
    1735                         "description": "Call stack information."
    1736                     }
     1740                    { "name": "callFrames", "type": "array", "items": { "$ref": "CallFrame" }, "description": "Call stack the virtual machine stopped on." },
     1741                    { "name": "reason", "type": "string", "enum": [ "XHR", "DOM", "EventListener", "exception", "other" ], "description": "Pause reason." },
     1742                    { "name": "data", "type": "object", "optional": true, "description": "Object containing break-specific auxiliary properties." }
    17371743                ],
    17381744                "description": "Fired when the virtual machine stopped on breakpoint or exception or any other stop criteria."
  • trunk/Source/WebCore/inspector/InspectorDOMDebuggerAgent.cpp

    r93125 r95538  
    147147        RefPtr<InspectorObject> eventData = InspectorObject::create();
    148148        descriptionForDOMEvent(node, AttributeModified, false, eventData.get());
    149         eventData->setString("breakpointType", domNativeBreakpointType);
    150         m_debuggerAgent->breakProgram(NativeBreakpointDebuggerEventType, eventData.release());
     149        m_debuggerAgent->breakProgram(domNativeBreakpointType, eventData.release());
    151150    }
    152151}
     
    242241        RefPtr<InspectorObject> eventData = InspectorObject::create();
    243242        descriptionForDOMEvent(parent, SubtreeModified, true, eventData.get());
    244         eventData->setString("breakpointType", domNativeBreakpointType);
    245         m_debuggerAgent->breakProgram(NativeBreakpointDebuggerEventType, eventData.release());
     243        m_debuggerAgent->breakProgram(domNativeBreakpointType, eventData.release());
    246244    }
    247245}
     
    253251        RefPtr<InspectorObject> eventData = InspectorObject::create();
    254252        descriptionForDOMEvent(node, NodeRemoved, false, eventData.get());
    255         eventData->setString("breakpointType", domNativeBreakpointType);
    256         m_debuggerAgent->breakProgram(NativeBreakpointDebuggerEventType, eventData.release());
     253        m_debuggerAgent->breakProgram(domNativeBreakpointType, eventData.release());
    257254    } else if (parentNode && hasBreakpoint(parentNode, SubtreeModified)) {
    258255        RefPtr<InspectorObject> eventData = InspectorObject::create();
    259256        descriptionForDOMEvent(node, SubtreeModified, false, eventData.get());
    260         eventData->setString("breakpointType", domNativeBreakpointType);
    261         m_debuggerAgent->breakProgram(NativeBreakpointDebuggerEventType, eventData.release());
     257        m_debuggerAgent->breakProgram(domNativeBreakpointType, eventData.release());
    262258    }
    263259}
     
    268264        RefPtr<InspectorObject> eventData = InspectorObject::create();
    269265        descriptionForDOMEvent(element, AttributeModified, false, eventData.get());
    270         eventData->setString("breakpointType", domNativeBreakpointType);
    271         m_debuggerAgent->breakProgram(NativeBreakpointDebuggerEventType, eventData.release());
     266        m_debuggerAgent->breakProgram(domNativeBreakpointType, eventData.release());
    272267    }
    273268}
     
    336331
    337332    RefPtr<InspectorObject> eventData = InspectorObject::create();
    338     eventData->setString("breakpointType", eventListenerNativeBreakpointType);
    339333    eventData->setString("eventName", fullEventName);
    340334    if (synchronous)
    341         m_debuggerAgent->breakProgram(NativeBreakpointDebuggerEventType, eventData.release());
     335        m_debuggerAgent->breakProgram(eventListenerNativeBreakpointType, eventData.release());
    342336    else
    343         m_debuggerAgent->schedulePauseOnNextStatement(NativeBreakpointDebuggerEventType, eventData.release());
     337        m_debuggerAgent->schedulePauseOnNextStatement(eventListenerNativeBreakpointType, eventData.release());
    344338}
    345339
     
    387381
    388382    RefPtr<InspectorObject> eventData = InspectorObject::create();
    389     eventData->setString("breakpointType", xhrNativeBreakpointType);
    390383    eventData->setString("breakpointURL", breakpointURL);
    391384    eventData->setString("url", url);
    392     m_debuggerAgent->breakProgram(NativeBreakpointDebuggerEventType, eventData.release());
     385    m_debuggerAgent->breakProgram(xhrNativeBreakpointType, eventData.release());
    393386}
    394387
  • trunk/Source/WebCore/inspector/InspectorDebuggerAgent.cpp

    r93962 r95538  
    6161    , m_listener(0)
    6262{
     63    // FIXME: make breakReason optional so that there was no need to init it with "other".
     64    clearBreakDetails();
    6365}
    6466
     
    336338}
    337339
    338 void InspectorDebuggerAgent::schedulePauseOnNextStatement(DebuggerEventType type, PassRefPtr<InspectorValue> data)
     340void InspectorDebuggerAgent::schedulePauseOnNextStatement(const String& breakReason, PassRefPtr<InspectorObject> data)
    339341{
    340342    if (m_javaScriptPauseScheduled)
    341343        return;
    342     m_breakProgramDetails = InspectorObject::create();
    343     m_breakProgramDetails->setNumber("eventType", type);
    344     m_breakProgramDetails->setValue("eventData", data);
     344    m_breakReason = breakReason;
     345    m_breakAuxData = data;
    345346    scriptDebugServer().setPauseOnNextStatement(true);
    346347}
     
    350351    if (m_javaScriptPauseScheduled)
    351352        return;
    352     m_breakProgramDetails = 0;
     353    clearBreakDetails();
    353354    scriptDebugServer().setPauseOnNextStatement(false);
    354355}
     
    356357void InspectorDebuggerAgent::pause(ErrorString*)
    357358{
    358     schedulePauseOnNextStatement(JavaScriptPauseEventType, InspectorObject::create());
     359    if (m_javaScriptPauseScheduled)
     360        return;
     361    clearBreakDetails();
     362    scriptDebugServer().setPauseOnNextStatement(true);
    359363    m_javaScriptPauseScheduled = true;
    360364}
     
    471475    m_currentCallStack = callFrames;
    472476
    473     if (!m_breakProgramDetails)
    474         m_breakProgramDetails = InspectorObject::create();
    475     m_breakProgramDetails->setValue("callFrames", currentCallFrames());
    476 
    477477    if (!exception.hasNoValue()) {
    478478        InjectedScript injectedScript = m_injectedScriptManager->injectedScriptFor(scriptState);
    479         if (!injectedScript.hasNoValue())
    480             m_breakProgramDetails->setValue("exception", injectedScript.wrapObject(exception, "backtrace"));
    481     }
    482 
    483     m_frontend->paused(m_breakProgramDetails);
     479        if (!injectedScript.hasNoValue()) {
     480            m_breakReason = "exception";
     481            m_breakAuxData = injectedScript.wrapObject(exception, "backtrace");
     482        }
     483    }
     484
     485    m_frontend->paused(currentCallFrames(), m_breakReason, m_breakAuxData);
    484486    m_javaScriptPauseScheduled = false;
    485487
     
    494496    m_pausedScriptState = 0;
    495497    m_currentCallStack = ScriptValue();
    496     m_breakProgramDetails = 0;
     498    clearBreakDetails();
    497499    m_frontend->resumed();
    498500}
    499501
    500 void InspectorDebuggerAgent::breakProgram(DebuggerEventType type, PassRefPtr<InspectorValue> data)
    501 {
    502     m_breakProgramDetails = InspectorObject::create();
    503     m_breakProgramDetails->setNumber("eventType", type);
    504     m_breakProgramDetails->setValue("eventData", data);
     502void InspectorDebuggerAgent::breakProgram(const String& breakReason, PassRefPtr<InspectorObject> data)
     503{
     504    m_breakReason = breakReason;
     505    m_breakAuxData = data;
    505506    scriptDebugServer().breakProgram();
    506507}
     
    513514    m_breakpointIdToDebugServerBreakpointIds.clear();
    514515    m_continueToLocationBreakpointId = String();
    515     m_breakProgramDetails.clear();
     516    clearBreakDetails();
    516517    m_javaScriptPauseScheduled = false;
    517518}
     
    526527}
    527528
     529void InspectorDebuggerAgent::clearBreakDetails()
     530{
     531    m_breakReason = "other";
     532    m_breakAuxData = 0;
     533}
     534
    528535} // namespace WebCore
    529536
  • trunk/Source/WebCore/inspector/InspectorDebuggerAgent.h

    r93586 r95538  
    5858typedef String ErrorString;
    5959
    60 enum DebuggerEventType {
    61     JavaScriptPauseEventType,
    62     JavaScriptBreakpointEventType,
    63     NativeBreakpointDebuggerEventType
    64 };
    65 
    6660class InspectorDebuggerAgent : public ScriptDebugListener {
    6761    WTF_MAKE_NONCOPYABLE(InspectorDebuggerAgent); WTF_MAKE_FAST_ALLOCATED;
     
    9084    void setScriptSource(ErrorString*, const String& scriptId, const String& newContent, const bool* const preview, RefPtr<InspectorArray>* newCallFrames, RefPtr<InspectorObject>* result);
    9185    void getScriptSource(ErrorString*, const String& scriptId, String* scriptSource);
    92     void schedulePauseOnNextStatement(DebuggerEventType type, PassRefPtr<InspectorValue> data);
     86    void schedulePauseOnNextStatement(const String& breakReason, PassRefPtr<InspectorObject> data);
    9387    void cancelPauseOnNextStatement();
    94     void breakProgram(DebuggerEventType type, PassRefPtr<InspectorValue> data);
     88    void breakProgram(const String& breakReason, PassRefPtr<InspectorObject> data);
    9589    void pause(ErrorString*);
    9690    void resume(ErrorString*);
     
    138132    void clear();
    139133    bool assertPaused(ErrorString*);
     134    void clearBreakDetails();
    140135
    141136    typedef HashMap<String, Script> ScriptsMap;
     
    151146    BreakpointIdToDebugServerBreakpointIdsMap m_breakpointIdToDebugServerBreakpointIds;
    152147    String m_continueToLocationBreakpointId;
    153     RefPtr<InspectorObject> m_breakProgramDetails;
     148    String m_breakReason;
     149    RefPtr<InspectorObject> m_breakAuxData;
    154150    bool m_javaScriptPauseScheduled;
    155151    Listener* m_listener;
  • trunk/Source/WebCore/inspector/front-end/DOMBreakpointsSidebarPane.js

    r93701 r95538  
    8787    },
    8888
    89     createBreakpointHitStatusMessage: function(eventData, callback)
    90     {
    91         if (eventData.type === this._breakpointTypes.SubtreeModified) {
    92             var targetNodeObject = WebInspector.RemoteObject.fromPayload(eventData.targetNode);
     89    createBreakpointHitStatusMessage: function(auxData, callback)
     90    {
     91        if (auxData.type === this._breakpointTypes.SubtreeModified) {
     92            var targetNodeObject = WebInspector.RemoteObject.fromPayload(auxData.targetNode);
    9393            function didPushNodeToFrontend(targetNodeId)
    9494            {
    9595                if (targetNodeId)
    9696                    targetNodeObject.release();
    97                 this._doCreateBreakpointHitStatusMessage(eventData, targetNodeId, callback);
     97                this._doCreateBreakpointHitStatusMessage(auxData, targetNodeId, callback);
    9898            }
    9999            targetNodeObject.pushNodeToFrontend(didPushNodeToFrontend.bind(this));
    100100        } else
    101             this._doCreateBreakpointHitStatusMessage(eventData, null, callback);
    102     },
    103 
    104     _doCreateBreakpointHitStatusMessage: function (eventData, targetNodeId, callback)
     101            this._doCreateBreakpointHitStatusMessage(auxData, null, callback);
     102    },
     103
     104    _doCreateBreakpointHitStatusMessage: function (auxData, targetNodeId, callback)
    105105    {
    106106        var message;
    107         var typeLabel = this._breakpointTypeLabels[eventData.type];
    108         var linkifiedNode = WebInspector.panels.elements.linkifyNodeById(eventData.nodeId);
     107        var typeLabel = this._breakpointTypeLabels[auxData.type];
     108        var linkifiedNode = WebInspector.panels.elements.linkifyNodeById(auxData.nodeId);
    109109        var substitutions = [typeLabel, linkifiedNode];
    110110        var targetNode = "";
     
    112112            targetNode = WebInspector.panels.elements.linkifyNodeById(targetNodeId);
    113113
    114         if (eventData.type === this._breakpointTypes.SubtreeModified) {
    115             if (eventData.insertion) {
    116                 if (targetNodeId !== eventData.nodeId) {
     114        if (auxData.type === this._breakpointTypes.SubtreeModified) {
     115            if (auxData.insertion) {
     116                if (targetNodeId !== auxData.nodeId) {
    117117                    message = "Paused on a \"%s\" breakpoint set on %s, because a new child was added to its descendant %s.";
    118118                    substitutions.push(targetNode);
     
    241241    },
    242242
    243     highlightBreakpoint: function(eventData)
    244     {
    245         var breakpointId = this._createBreakpointId(eventData.nodeId, eventData.type);
     243    highlightBreakpoint: function(auxData)
     244    {
     245        var breakpointId = this._createBreakpointId(auxData.nodeId, auxData.type);
    246246        var element = this._breakpointElements[breakpointId];
    247247        if (!element)
  • trunk/Source/WebCore/inspector/front-end/DebuggerModel.js

    r93769 r95538  
    191191    },
    192192
    193     _pausedScript: function(details)
    194     {
     193    _pausedScript: function(callFrames, reason, auxData)
     194    {
     195        var details = { callFrames: callFrames, reason: reason, auxData: auxData };
    195196        this._debuggerPausedDetails = details;
    196197        this.dispatchEventToListeners(WebInspector.DebuggerModel.Events.DebuggerPaused, details);
     
    235236
    236237WebInspector.DebuggerDispatcher.prototype = {
    237     paused: function(details)
    238     {
    239         this._debuggerModel._pausedScript(details);
     238    paused: function(callFrames, reason, auxData)
     239    {
     240        this._debuggerModel._pausedScript(callFrames, reason, auxData);
    240241    },
    241242
  • trunk/Source/WebCore/inspector/front-end/DebuggerPresentationModel.js

    r95524 r95538  
    490490                callback(WebInspector.RemoteObject.fromPayload(result), wasThrown);
    491491        }
    492         DebuggerAgent.evaluateOnCallFrame(this._callFrame.id, code, objectGroup, includeCommandLineAPI, returnByValue, didEvaluateOnCallFrame.bind(this));
     492        DebuggerAgent.evaluateOnCallFrame(this._callFrame.callFrameId, code, objectGroup, includeCommandLineAPI, returnByValue, didEvaluateOnCallFrame.bind(this));
    493493    },
    494494
  • trunk/Source/WebCore/inspector/front-end/ScopeChainSidebarPane.js

    r86835 r95538  
    7676                        extraProperties = [ new WebInspector.RemoteObjectProperty("this", WebInspector.RemoteObject.fromPayload(callFrame.this)) ];
    7777                    if (i == 0) {
    78                         var exception = WebInspector.debuggerModel.debuggerPausedDetails.exception;
     78                        var details = WebInspector.debuggerModel.debuggerPausedDetails;
     79                        var exception = details.reason === WebInspector.ScriptsPanel.BreakReason.Exception ? details.auxData : 0;
    7980                        if (exception) {
    8081                            extraProperties = extraProperties || [];
  • trunk/Source/WebCore/inspector/front-end/ScriptsPanel.js

    r95287 r95538  
    186186};
    187187
    188 WebInspector.ScriptsPanel.BrowserBreakpointTypes = {
     188WebInspector.ScriptsPanel.BreakReason = {
    189189    DOM: "DOM",
    190190    EventListener: "EventListener",
    191     XHR: "XHR"
     191    XHR: "XHR",
     192    Exception: "exception"
    192193}
    193194
     
    479480        this.sidebarPanes.callstack.selectedCallFrame = this._presentationModel.selectedCallFrame;
    480481
    481         if (details.eventType === WebInspector.DebuggerEventTypes.NativeBreakpoint) {
    482             if (details.eventData.breakpointType === WebInspector.ScriptsPanel.BrowserBreakpointTypes.DOM) {
    483                 this.sidebarPanes.domBreakpoints.highlightBreakpoint(details.eventData);
    484                 function didCreateBreakpointHitStatusMessage(element)
    485                 {
    486                     this.sidebarPanes.callstack.setStatus(element);
    487                 }
    488                 this.sidebarPanes.domBreakpoints.createBreakpointHitStatusMessage(details.eventData, didCreateBreakpointHitStatusMessage.bind(this));
    489             } else if (details.eventData.breakpointType === WebInspector.ScriptsPanel.BrowserBreakpointTypes.EventListener) {
    490                 var eventName = details.eventData.eventName;
    491                 this.sidebarPanes.eventListenerBreakpoints.highlightBreakpoint(details.eventData.eventName);
    492                 var eventNameForUI = WebInspector.EventListenerBreakpointsSidebarPane.eventNameForUI(eventName);
    493                 this.sidebarPanes.callstack.setStatus(WebInspector.UIString("Paused on a \"%s\" Event Listener.", eventNameForUI));
    494             } else if (details.eventData.breakpointType === WebInspector.ScriptsPanel.BrowserBreakpointTypes.XHR) {
    495                 this.sidebarPanes.xhrBreakpoints.highlightBreakpoint(details.eventData.breakpointURL);
    496                 this.sidebarPanes.callstack.setStatus(WebInspector.UIString("Paused on a XMLHttpRequest."));
     482        if (details.reason === WebInspector.ScriptsPanel.BreakReason.DOM) {
     483            this.sidebarPanes.domBreakpoints.highlightBreakpoint(details.auxData);
     484            function didCreateBreakpointHitStatusMessage(element)
     485            {
     486                this.sidebarPanes.callstack.setStatus(element);
    497487            }
     488            this.sidebarPanes.domBreakpoints.createBreakpointHitStatusMessage(details.auxData, didCreateBreakpointHitStatusMessage.bind(this));
     489        } else if (details.reason === WebInspector.ScriptsPanel.BreakReason.EventListener) {
     490            var eventName = details.auxData.eventName;
     491            this.sidebarPanes.eventListenerBreakpoints.highlightBreakpoint(details.auxData.eventName);
     492            var eventNameForUI = WebInspector.EventListenerBreakpointsSidebarPane.eventNameForUI(eventName);
     493            this.sidebarPanes.callstack.setStatus(WebInspector.UIString("Paused on a \"%s\" Event Listener.", eventNameForUI));
     494        } else if (details.reason === WebInspector.ScriptsPanel.BreakReason.XHR) {
     495            this.sidebarPanes.xhrBreakpoints.highlightBreakpoint(details.auxData.breakpointURL);
     496            this.sidebarPanes.callstack.setStatus(WebInspector.UIString("Paused on a XMLHttpRequest."));
     497        } else if (details.reason === WebInspector.ScriptsPanel.BreakReason.Exception) {
     498            this.sidebarPanes.callstack.setStatus(WebInspector.UIString("Paused on exception: '%s'.", details.auxData.description));
    498499        } else {
    499500            function didGetSourceLocation(uiSourceCode, lineNumber)
    500501            {
    501                 var exception = WebInspector.debuggerModel.debuggerPausedDetails.exception;
    502                 if (exception) {
    503                     this.sidebarPanes.callstack.setStatus(WebInspector.UIString("Paused on exception: '%s'.", exception.description));
    504                     return;
    505                 }
    506 
    507502                if (!uiSourceCode || !this._presentationModel.findBreakpoint(uiSourceCode, lineNumber))
    508503                    return;
Note: See TracChangeset for help on using the changeset viewer.