Changeset 95538 in webkit
- Timestamp:
- Sep 20, 2011 7:00:37 AM (13 years ago)
- Location:
- trunk
- Files:
-
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r95536 r95538 1 2011-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 1 14 2011-09-15 Pavel Feldman <pfeldman@google.com> 2 15 -
trunk/LayoutTests/http/tests/inspector/debugger-test.js
r92958 r95538 132 132 }; 133 133 134 InspectorTest._pausedScript = function( details)134 InspectorTest._pausedScript = function(callFrames, reason, auxData) 135 135 { 136 136 if (!InspectorTest._quiet) 137 137 InspectorTest.addResult("Script execution paused."); 138 InspectorTest._callFrames = details.callFrames;138 InspectorTest._callFrames = callFrames; 139 139 if (InspectorTest._waitUntilPausedCallback) { 140 140 var callback = InspectorTest._waitUntilPausedCallback; -
trunk/Source/WebCore/ChangeLog
r95536 r95538 1 2011-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 48 2011-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 1 57 2011-09-15 Pavel Feldman <pfeldman@google.com> 2 58 -
trunk/Source/WebCore/inspector/InjectedScriptSource.js
r94958 r95538 489 489 InjectedScript.CallFrameProxy = function(ordinal, callFrame) 490 490 { 491 this. id = "{\"ordinal\":" + ordinal + ",\"injectedScriptId\":" + injectedScriptId + "}";491 this.callFrameId = "{\"ordinal\":" + ordinal + ",\"injectedScriptId\":" + injectedScriptId + "}"; 492 492 this.functionName = (callFrame.type === "function" ? callFrame.functionName : ""); 493 493 this.location = { scriptId: String(callFrame.sourceID), lineNumber: callFrame.line, columnNumber: callFrame.column }; -
trunk/Source/WebCore/inspector/Inspector.json
r95535 r95538 255 255 { "name": "name", "type": "string", "description": "Property name." }, 256 256 { "name": "value", "$ref": "RemoteObject", "optional": true, "description": "The value associated with the property." }, 257 { "name": "writable", "type": "boolean", "description": "True if fthe 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)." }, 258 258 { "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)." }, 259 259 { "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 if fthe 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 fthis property shows up during enumeration of the properties on the corresponding object." },262 { "name": "wasThrown", "type": "boolean", "optional": true, "description": "True if fthe 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." } 263 263 ] 264 264 }, … … 279 279 { "name": "expression", "type": "string", "description": "Expression to evaluate." }, 280 280 { "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 }, 283 283 { "name": "frameId", "type": "string", "optional": true, "description": "Specifies in which frame to perform evaluation.", "hidden": true }, 284 284 { "name": "returnByValue", "type": "boolean", "optional": true, "description": "Whether the result is expected to be a JSON object that should be sent by value." } … … 286 286 "returns": [ 287 287 { "name": "result", "$ref": "RemoteObject", "description": "Evaluation result." }, 288 { "name": "wasThrown", "type": "boolean", "optional": true, "description": "True if fthe result was thrown during the evaluation." }288 { "name": "wasThrown", "type": "boolean", "optional": true, "description": "True if the result was thrown during the evaluation." } 289 289 ], 290 290 "description": "Evaluates expression on global object." … … 300 300 "returns": [ 301 301 { "name": "result", "$ref": "RemoteObject", "description": "Call result." }, 302 { "name": "wasThrown", "type": "boolean", "optional": true, "description": "True if fthe result was thrown during the evaluation." }302 { "name": "wasThrown", "type": "boolean", "optional": true, "description": "True if the result was thrown during the evaluation." } 303 303 ], 304 304 "description": "Calls function with given declaration on the given object." … … 1520 1520 { 1521 1521 "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.", 1523 1523 "types": [ 1524 { 1525 "id": "BreakpointId", 1526 "type": "string", 1527 "description": "Breakpoint identifier." 1528 }, 1524 1529 { 1525 1530 "id": "ScriptId", … … 1528 1533 }, 1529 1534 { 1535 "id": "CallFrameId", 1536 "type": "string", 1537 "description": "Call frame identifier." 1538 }, 1539 { 1530 1540 "id": "Location", 1531 1541 "type": "object", … … 1541 1551 "type": "object", 1542 1552 "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." }, 1544 1554 { "name": "functionName", "type": "string", "description": "Name of the JavaScript function called on this call frame." }, 1545 1555 { "name": "location", "$ref": "Location", "description": "Location in the source code." }, … … 1585 1595 ], 1586 1596 "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." }, 1588 1598 { "name": "locations", "optional": true, "type": "array", "items": { "$ref": "Location"}, "description": "List of the locations this breakpoint resolved into upon addition." } 1589 1599 ], 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." 1591 1601 }, 1592 1602 { … … 1597 1607 ], 1598 1608 "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." }, 1600 1610 { "name": "actualLocation", "$ref": "Location", "description": "Location this breakpoint resolved into." } 1601 1611 ], … … 1605 1615 "name": "removeBreakpoint", 1606 1616 "parameters": [ 1607 { "name": "breakpointId", " type": "string" }1617 { "name": "breakpointId", "$ref": "BreakpointId" } 1608 1618 ], 1609 1619 "description": "Removes JavaScript breakpoint." … … 1622 1632 { 1623 1633 "name": "stepInto", 1624 "description": "Steps into the statement."1634 "description": "Steps into the function call." 1625 1635 }, 1626 1636 { 1627 1637 "name": "stepOut", 1628 "description": "Steps out of the function ."1638 "description": "Steps out of the function call." 1629 1639 }, 1630 1640 { … … 1641 1651 { "name": "scriptId", "$ref": "ScriptId", "description": "Id of the script to edit." }, 1642 1652 { "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 } 1644 1654 ], 1645 1655 "returns": [ 1646 1656 { "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 } 1648 1658 ], 1649 1659 "description": "Edits JavaScript source live." … … 1657 1667 { "name": "scriptSource", "type": "string", "description": "Script source." } 1658 1668 ], 1659 "description": "Returns source for the script with given ID."1669 "description": "Returns source for the script with given id." 1660 1670 }, 1661 1671 { … … 1664 1674 { "name": "state", "type": "string", "enum": ["none", "uncaught", "all"], "description": "Pause on exceptions mode." } 1665 1675 ], 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>." 1667 1677 }, 1668 1678 { 1669 1679 "name": "evaluateOnCallFrame", 1670 1680 "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." }, 1672 1682 { "name": "expression", "type": "string", "description": "Expression to evaluate." }, 1673 1683 { "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 }, 1675 1685 { "name": "returnByValue", "type": "boolean", "optional": true, "description": "Whether the result is expected to be a JSON object that should be sent by value." } 1676 1686 ], 1677 1687 "returns": [ 1678 1688 { "name": "result", "$ref": "Runtime.RemoteObject", "description": "Object wrapper for the evaluation result." }, 1679 { "name": "wasThrown", "type": "boolean", "optional": true, "description": "True if fthe result was thrown during the evaluation." }1689 { "name": "wasThrown", "type": "boolean", "optional": true, "description": "True if the result was thrown during the evaluation." } 1680 1690 ], 1681 1691 "description": "Evaluates expression on a given call frame." … … 1685 1695 { 1686 1696 "name": "debuggerWasEnabled", 1687 "description": "Fired when debugger gets enabled (deprecated)." 1697 "description": "Fired when debugger gets enabled (deprecated).", 1698 "hidden": true 1688 1699 }, 1689 1700 { 1690 1701 "name": "debuggerWasDisabled", 1691 "description": "Fired when debugger gets disabled (deprecated)." 1702 "description": "Fired when debugger gets disabled (deprecated).", 1703 "hidden": true 1692 1704 }, 1693 1705 { … … 1695 1707 "parameters": [ 1696 1708 { "name": "scriptId", "$ref": "ScriptId", "description": "Identifier of the script parsed." }, 1697 { "name": "url", "type": "string", "description": "URL o f the script parsed (if any)." },1709 { "name": "url", "type": "string", "description": "URL or name of the script parsed (if any)." }, 1698 1710 { "name": "startLine", "type": "integer", "description": "Line offset of the script within the resource with given URL (for script tags)." }, 1699 1711 { "name": "startColumn", "type": "integer", "description": "Column offset of the script within the resource with given URL." }, … … 1702 1714 { "name": "isContentScript", "type": "boolean", "optional": true, "description": "Determines whether this script is a user extension script." } 1703 1715 ], 1704 "description": "Fired when virtual machine parses script. This even is also fired for all knownscripts 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." 1705 1717 }, 1706 1718 { … … 1708 1720 "parameters": [ 1709 1721 { "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." }, 1712 1724 { "name": "errorLine", "type": "integer", "description": "Line with error." }, 1713 1725 { "name": "errorMessage", "type": "string", "description": "Parse error message." } … … 1718 1730 "name": "breakpointResolved", 1719 1731 "parameters": [ 1720 { "name": "breakpointId", " type": "string", "description": "Breakpoint unique identifier." },1732 { "name": "breakpointId", "$ref": "BreakpointId", "description": "Breakpoint unique identifier." }, 1721 1733 { "name": "location", "$ref": "Location", "description": "Actual breakpoint location." } 1722 1734 ], … … 1726 1738 "name": "paused", 1727 1739 "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." } 1737 1743 ], 1738 1744 "description": "Fired when the virtual machine stopped on breakpoint or exception or any other stop criteria." -
trunk/Source/WebCore/inspector/InspectorDOMDebuggerAgent.cpp
r93125 r95538 147 147 RefPtr<InspectorObject> eventData = InspectorObject::create(); 148 148 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()); 151 150 } 152 151 } … … 242 241 RefPtr<InspectorObject> eventData = InspectorObject::create(); 243 242 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()); 246 244 } 247 245 } … … 253 251 RefPtr<InspectorObject> eventData = InspectorObject::create(); 254 252 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()); 257 254 } else if (parentNode && hasBreakpoint(parentNode, SubtreeModified)) { 258 255 RefPtr<InspectorObject> eventData = InspectorObject::create(); 259 256 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()); 262 258 } 263 259 } … … 268 264 RefPtr<InspectorObject> eventData = InspectorObject::create(); 269 265 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()); 272 267 } 273 268 } … … 336 331 337 332 RefPtr<InspectorObject> eventData = InspectorObject::create(); 338 eventData->setString("breakpointType", eventListenerNativeBreakpointType);339 333 eventData->setString("eventName", fullEventName); 340 334 if (synchronous) 341 m_debuggerAgent->breakProgram( NativeBreakpointDebuggerEventType, eventData.release());335 m_debuggerAgent->breakProgram(eventListenerNativeBreakpointType, eventData.release()); 342 336 else 343 m_debuggerAgent->schedulePauseOnNextStatement( NativeBreakpointDebuggerEventType, eventData.release());337 m_debuggerAgent->schedulePauseOnNextStatement(eventListenerNativeBreakpointType, eventData.release()); 344 338 } 345 339 … … 387 381 388 382 RefPtr<InspectorObject> eventData = InspectorObject::create(); 389 eventData->setString("breakpointType", xhrNativeBreakpointType);390 383 eventData->setString("breakpointURL", breakpointURL); 391 384 eventData->setString("url", url); 392 m_debuggerAgent->breakProgram( NativeBreakpointDebuggerEventType, eventData.release());385 m_debuggerAgent->breakProgram(xhrNativeBreakpointType, eventData.release()); 393 386 } 394 387 -
trunk/Source/WebCore/inspector/InspectorDebuggerAgent.cpp
r93962 r95538 61 61 , m_listener(0) 62 62 { 63 // FIXME: make breakReason optional so that there was no need to init it with "other". 64 clearBreakDetails(); 63 65 } 64 66 … … 336 338 } 337 339 338 void InspectorDebuggerAgent::schedulePauseOnNextStatement( DebuggerEventType type, PassRefPtr<InspectorValue> data)340 void InspectorDebuggerAgent::schedulePauseOnNextStatement(const String& breakReason, PassRefPtr<InspectorObject> data) 339 341 { 340 342 if (m_javaScriptPauseScheduled) 341 343 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; 345 346 scriptDebugServer().setPauseOnNextStatement(true); 346 347 } … … 350 351 if (m_javaScriptPauseScheduled) 351 352 return; 352 m_breakProgramDetails = 0;353 clearBreakDetails(); 353 354 scriptDebugServer().setPauseOnNextStatement(false); 354 355 } … … 356 357 void InspectorDebuggerAgent::pause(ErrorString*) 357 358 { 358 schedulePauseOnNextStatement(JavaScriptPauseEventType, InspectorObject::create()); 359 if (m_javaScriptPauseScheduled) 360 return; 361 clearBreakDetails(); 362 scriptDebugServer().setPauseOnNextStatement(true); 359 363 m_javaScriptPauseScheduled = true; 360 364 } … … 471 475 m_currentCallStack = callFrames; 472 476 473 if (!m_breakProgramDetails)474 m_breakProgramDetails = InspectorObject::create();475 m_breakProgramDetails->setValue("callFrames", currentCallFrames());476 477 477 if (!exception.hasNoValue()) { 478 478 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); 484 486 m_javaScriptPauseScheduled = false; 485 487 … … 494 496 m_pausedScriptState = 0; 495 497 m_currentCallStack = ScriptValue(); 496 m_breakProgramDetails = 0;498 clearBreakDetails(); 497 499 m_frontend->resumed(); 498 500 } 499 501 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); 502 void InspectorDebuggerAgent::breakProgram(const String& breakReason, PassRefPtr<InspectorObject> data) 503 { 504 m_breakReason = breakReason; 505 m_breakAuxData = data; 505 506 scriptDebugServer().breakProgram(); 506 507 } … … 513 514 m_breakpointIdToDebugServerBreakpointIds.clear(); 514 515 m_continueToLocationBreakpointId = String(); 515 m_breakProgramDetails.clear();516 clearBreakDetails(); 516 517 m_javaScriptPauseScheduled = false; 517 518 } … … 526 527 } 527 528 529 void InspectorDebuggerAgent::clearBreakDetails() 530 { 531 m_breakReason = "other"; 532 m_breakAuxData = 0; 533 } 534 528 535 } // namespace WebCore 529 536 -
trunk/Source/WebCore/inspector/InspectorDebuggerAgent.h
r93586 r95538 58 58 typedef String ErrorString; 59 59 60 enum DebuggerEventType {61 JavaScriptPauseEventType,62 JavaScriptBreakpointEventType,63 NativeBreakpointDebuggerEventType64 };65 66 60 class InspectorDebuggerAgent : public ScriptDebugListener { 67 61 WTF_MAKE_NONCOPYABLE(InspectorDebuggerAgent); WTF_MAKE_FAST_ALLOCATED; … … 90 84 void setScriptSource(ErrorString*, const String& scriptId, const String& newContent, const bool* const preview, RefPtr<InspectorArray>* newCallFrames, RefPtr<InspectorObject>* result); 91 85 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); 93 87 void cancelPauseOnNextStatement(); 94 void breakProgram( DebuggerEventType type, PassRefPtr<InspectorValue> data);88 void breakProgram(const String& breakReason, PassRefPtr<InspectorObject> data); 95 89 void pause(ErrorString*); 96 90 void resume(ErrorString*); … … 138 132 void clear(); 139 133 bool assertPaused(ErrorString*); 134 void clearBreakDetails(); 140 135 141 136 typedef HashMap<String, Script> ScriptsMap; … … 151 146 BreakpointIdToDebugServerBreakpointIdsMap m_breakpointIdToDebugServerBreakpointIds; 152 147 String m_continueToLocationBreakpointId; 153 RefPtr<InspectorObject> m_breakProgramDetails; 148 String m_breakReason; 149 RefPtr<InspectorObject> m_breakAuxData; 154 150 bool m_javaScriptPauseScheduled; 155 151 Listener* m_listener; -
trunk/Source/WebCore/inspector/front-end/DOMBreakpointsSidebarPane.js
r93701 r95538 87 87 }, 88 88 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); 93 93 function didPushNodeToFrontend(targetNodeId) 94 94 { 95 95 if (targetNodeId) 96 96 targetNodeObject.release(); 97 this._doCreateBreakpointHitStatusMessage( eventData, targetNodeId, callback);97 this._doCreateBreakpointHitStatusMessage(auxData, targetNodeId, callback); 98 98 } 99 99 targetNodeObject.pushNodeToFrontend(didPushNodeToFrontend.bind(this)); 100 100 } 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) 105 105 { 106 106 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); 109 109 var substitutions = [typeLabel, linkifiedNode]; 110 110 var targetNode = ""; … … 112 112 targetNode = WebInspector.panels.elements.linkifyNodeById(targetNodeId); 113 113 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) { 117 117 message = "Paused on a \"%s\" breakpoint set on %s, because a new child was added to its descendant %s."; 118 118 substitutions.push(targetNode); … … 241 241 }, 242 242 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); 246 246 var element = this._breakpointElements[breakpointId]; 247 247 if (!element) -
trunk/Source/WebCore/inspector/front-end/DebuggerModel.js
r93769 r95538 191 191 }, 192 192 193 _pausedScript: function(details) 194 { 193 _pausedScript: function(callFrames, reason, auxData) 194 { 195 var details = { callFrames: callFrames, reason: reason, auxData: auxData }; 195 196 this._debuggerPausedDetails = details; 196 197 this.dispatchEventToListeners(WebInspector.DebuggerModel.Events.DebuggerPaused, details); … … 235 236 236 237 WebInspector.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); 240 241 }, 241 242 -
trunk/Source/WebCore/inspector/front-end/DebuggerPresentationModel.js
r95524 r95538 490 490 callback(WebInspector.RemoteObject.fromPayload(result), wasThrown); 491 491 } 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)); 493 493 }, 494 494 -
trunk/Source/WebCore/inspector/front-end/ScopeChainSidebarPane.js
r86835 r95538 76 76 extraProperties = [ new WebInspector.RemoteObjectProperty("this", WebInspector.RemoteObject.fromPayload(callFrame.this)) ]; 77 77 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; 79 80 if (exception) { 80 81 extraProperties = extraProperties || []; -
trunk/Source/WebCore/inspector/front-end/ScriptsPanel.js
r95287 r95538 186 186 }; 187 187 188 WebInspector.ScriptsPanel.Br owserBreakpointTypes= {188 WebInspector.ScriptsPanel.BreakReason = { 189 189 DOM: "DOM", 190 190 EventListener: "EventListener", 191 XHR: "XHR" 191 XHR: "XHR", 192 Exception: "exception" 192 193 } 193 194 … … 479 480 this.sidebarPanes.callstack.selectedCallFrame = this._presentationModel.selectedCallFrame; 480 481 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); 497 487 } 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)); 498 499 } else { 499 500 function didGetSourceLocation(uiSourceCode, lineNumber) 500 501 { 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 507 502 if (!uiSourceCode || !this._presentationModel.findBreakpoint(uiSourceCode, lineNumber)) 508 503 return;
Note: See TracChangeset
for help on using the changeset viewer.