<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[69014] trunk/WebCore</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/69014">69014</a></dd>
<dt>Author</dt> <dd>podivilov@chromium.org</dd>
<dt>Date</dt> <dd>2010-10-04 07:52:38 -0700 (Mon, 04 Oct 2010)</dd>
</dl>

<h3>Log Message</h3>
<pre>2010-10-04  podivilov@chromium.org  &lt;podivilov@chromium.org&gt;

        Reviewed by Yury Semikhatsky.

        Web Inspector: implement pausing on event listeners (back-end part)
        https://bugs.webkit.org/show_bug.cgi?id=46624

        * bindings/js/ScriptDebugServer.cpp:
        (WebCore::ScriptDebugServer::setPauseOnNextStatement):
        * bindings/js/ScriptDebugServer.h:
        * bindings/v8/ScriptDebugServer.cpp:
        (WebCore::ScriptDebugServer::setPauseOnNextStatement):
        * bindings/v8/ScriptDebugServer.h:
        * dom/Node.cpp:
        (WebCore::Node::dispatchGenericEvent):
        * inspector/InspectorController.cpp:
        (WebCore::InspectorController::didCommitLoad):
        (WebCore::InspectorController::setNativeBreakpoint):
        (WebCore::InspectorController::removeNativeBreakpoint):
        (WebCore::InspectorController::shouldBreakOnEvent):
        (WebCore::InspectorController::shouldBreakOnXMLHttpRequest):
        * inspector/InspectorController.h:
        * inspector/InspectorDebuggerAgent.cpp:
        (WebCore::InspectorDebuggerAgent::~InspectorDebuggerAgent):
        (WebCore::InspectorDebuggerAgent::schedulePauseOnNextStatement):
        (WebCore::InspectorDebuggerAgent::cancelPauseOnNextStatement):
        (WebCore::InspectorDebuggerAgent::pause):
        (WebCore::InspectorDebuggerAgent::didContinue):
        (WebCore::InspectorDebuggerAgent::breakProgram):
        * inspector/InspectorDebuggerAgent.h:
        * inspector/InspectorInstrumentation.cpp:
        (WebCore::eventHasListeners):
        (WebCore::InspectorInstrumentation::instrumentWillDispatchEventImpl):
        (WebCore::InspectorInstrumentation::instrumentDidDispatchEventImpl):
        (WebCore::InspectorInstrumentation::instrumentWillSendXMLHttpRequestImpl):
        * inspector/InspectorInstrumentation.h:
        (WebCore::InspectorInstrumentation::instrumentWillDispatchEvent):
        (WebCore::InspectorInstrumentation::instrumentDidDispatchEvent):
        (WebCore::InspectorInstrumentation::instrumentWillSendXMLHttpRequest):
        * inspector/InspectorTimelineAgent.cpp:
        (WebCore::InspectorTimelineAgent::InspectorTimelineAgent):
        * inspector/InspectorTimelineAgent.h:
        (WebCore::InspectorTimelineAgent::id):
        * inspector/front-end/CallStackSidebarPane.js:</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkWebCoreChangeLog">trunk/WebCore/ChangeLog</a></li>
<li><a href="#trunkWebCorebindingsjsScriptDebugServercpp">trunk/WebCore/bindings/js/ScriptDebugServer.cpp</a></li>
<li><a href="#trunkWebCorebindingsjsScriptDebugServerh">trunk/WebCore/bindings/js/ScriptDebugServer.h</a></li>
<li><a href="#trunkWebCorebindingsv8ScriptDebugServercpp">trunk/WebCore/bindings/v8/ScriptDebugServer.cpp</a></li>
<li><a href="#trunkWebCorebindingsv8ScriptDebugServerh">trunk/WebCore/bindings/v8/ScriptDebugServer.h</a></li>
<li><a href="#trunkWebCoredomNodecpp">trunk/WebCore/dom/Node.cpp</a></li>
<li><a href="#trunkWebCoreinspectorInspectorControllercpp">trunk/WebCore/inspector/InspectorController.cpp</a></li>
<li><a href="#trunkWebCoreinspectorInspectorControllerh">trunk/WebCore/inspector/InspectorController.h</a></li>
<li><a href="#trunkWebCoreinspectorInspectorDebuggerAgentcpp">trunk/WebCore/inspector/InspectorDebuggerAgent.cpp</a></li>
<li><a href="#trunkWebCoreinspectorInspectorDebuggerAgenth">trunk/WebCore/inspector/InspectorDebuggerAgent.h</a></li>
<li><a href="#trunkWebCoreinspectorInspectorInstrumentationcpp">trunk/WebCore/inspector/InspectorInstrumentation.cpp</a></li>
<li><a href="#trunkWebCoreinspectorInspectorInstrumentationh">trunk/WebCore/inspector/InspectorInstrumentation.h</a></li>
<li><a href="#trunkWebCoreinspectorInspectorTimelineAgentcpp">trunk/WebCore/inspector/InspectorTimelineAgent.cpp</a></li>
<li><a href="#trunkWebCoreinspectorInspectorTimelineAgenth">trunk/WebCore/inspector/InspectorTimelineAgent.h</a></li>
<li><a href="#trunkWebCoreinspectorfrontendCallStackSidebarPanejs">trunk/WebCore/inspector/front-end/CallStackSidebarPane.js</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/WebCore/ChangeLog (69013 => 69014)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/ChangeLog        2010-10-04 14:28:46 UTC (rev 69013)
+++ trunk/WebCore/ChangeLog        2010-10-04 14:52:38 UTC (rev 69014)
</span><span class="lines">@@ -1,3 +1,48 @@
</span><ins>+2010-10-04  podivilov@chromium.org  &lt;podivilov@chromium.org&gt;
+
+        Reviewed by Yury Semikhatsky.
+
+        Web Inspector: implement pausing on event listeners (back-end part)
+        https://bugs.webkit.org/show_bug.cgi?id=46624
+
+        * bindings/js/ScriptDebugServer.cpp:
+        (WebCore::ScriptDebugServer::setPauseOnNextStatement):
+        * bindings/js/ScriptDebugServer.h:
+        * bindings/v8/ScriptDebugServer.cpp:
+        (WebCore::ScriptDebugServer::setPauseOnNextStatement):
+        * bindings/v8/ScriptDebugServer.h:
+        * dom/Node.cpp:
+        (WebCore::Node::dispatchGenericEvent):
+        * inspector/InspectorController.cpp:
+        (WebCore::InspectorController::didCommitLoad):
+        (WebCore::InspectorController::setNativeBreakpoint):
+        (WebCore::InspectorController::removeNativeBreakpoint):
+        (WebCore::InspectorController::shouldBreakOnEvent):
+        (WebCore::InspectorController::shouldBreakOnXMLHttpRequest):
+        * inspector/InspectorController.h:
+        * inspector/InspectorDebuggerAgent.cpp:
+        (WebCore::InspectorDebuggerAgent::~InspectorDebuggerAgent):
+        (WebCore::InspectorDebuggerAgent::schedulePauseOnNextStatement):
+        (WebCore::InspectorDebuggerAgent::cancelPauseOnNextStatement):
+        (WebCore::InspectorDebuggerAgent::pause):
+        (WebCore::InspectorDebuggerAgent::didContinue):
+        (WebCore::InspectorDebuggerAgent::breakProgram):
+        * inspector/InspectorDebuggerAgent.h:
+        * inspector/InspectorInstrumentation.cpp:
+        (WebCore::eventHasListeners):
+        (WebCore::InspectorInstrumentation::instrumentWillDispatchEventImpl):
+        (WebCore::InspectorInstrumentation::instrumentDidDispatchEventImpl):
+        (WebCore::InspectorInstrumentation::instrumentWillSendXMLHttpRequestImpl):
+        * inspector/InspectorInstrumentation.h:
+        (WebCore::InspectorInstrumentation::instrumentWillDispatchEvent):
+        (WebCore::InspectorInstrumentation::instrumentDidDispatchEvent):
+        (WebCore::InspectorInstrumentation::instrumentWillSendXMLHttpRequest):
+        * inspector/InspectorTimelineAgent.cpp:
+        (WebCore::InspectorTimelineAgent::InspectorTimelineAgent):
+        * inspector/InspectorTimelineAgent.h:
+        (WebCore::InspectorTimelineAgent::id):
+        * inspector/front-end/CallStackSidebarPane.js:
+
</ins><span class="cx"> 2010-10-04  Pavel Feldman  &lt;pfeldman@chromium.org&gt;
</span><span class="cx"> 
</span><span class="cx">         Reviewed by Yury Semikhatsky.
</span></span></pre></div>
<a id="trunkWebCorebindingsjsScriptDebugServercpp"></a>
<div class="modfile"><h4>Modified: trunk/WebCore/bindings/js/ScriptDebugServer.cpp (69013 => 69014)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/bindings/js/ScriptDebugServer.cpp        2010-10-04 14:28:46 UTC (rev 69013)
+++ trunk/WebCore/bindings/js/ScriptDebugServer.cpp        2010-10-04 14:52:38 UTC (rev 69014)
</span><span class="lines">@@ -200,9 +200,9 @@
</span><span class="cx">     m_pauseOnExceptionsState = pause;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void ScriptDebugServer::pause()
</del><ins>+void ScriptDebugServer::setPauseOnNextStatement(bool pause)
</ins><span class="cx"> {
</span><del>-    m_pauseOnNextStatement = true;
</del><ins>+    m_pauseOnNextStatement = pause;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void ScriptDebugServer::breakProgram()
</span></span></pre></div>
<a id="trunkWebCorebindingsjsScriptDebugServerh"></a>
<div class="modfile"><h4>Modified: trunk/WebCore/bindings/js/ScriptDebugServer.h (69013 => 69014)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/bindings/js/ScriptDebugServer.h        2010-10-04 14:28:46 UTC (rev 69013)
+++ trunk/WebCore/bindings/js/ScriptDebugServer.h        2010-10-04 14:52:38 UTC (rev 69014)
</span><span class="lines">@@ -78,7 +78,7 @@
</span><span class="cx">     PauseOnExceptionsState pauseOnExceptionsState() const { return m_pauseOnExceptionsState; }
</span><span class="cx">     void setPauseOnExceptionsState(PauseOnExceptionsState);
</span><span class="cx"> 
</span><del>-    void pause();
</del><ins>+    void setPauseOnNextStatement(bool pause);
</ins><span class="cx">     void breakProgram();
</span><span class="cx">     void continueProgram();
</span><span class="cx">     void stepIntoStatement();
</span></span></pre></div>
<a id="trunkWebCorebindingsv8ScriptDebugServercpp"></a>
<div class="modfile"><h4>Modified: trunk/WebCore/bindings/v8/ScriptDebugServer.cpp (69013 => 69014)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/bindings/v8/ScriptDebugServer.cpp        2010-10-04 14:28:46 UTC (rev 69013)
+++ trunk/WebCore/bindings/v8/ScriptDebugServer.cpp        2010-10-04 14:52:38 UTC (rev 69014)
</span><span class="lines">@@ -225,10 +225,14 @@
</span><span class="cx">     setPauseOnExceptionsFunction-&gt;Call(m_debuggerScript.get(), 1, argv);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void ScriptDebugServer::pause()
</del><ins>+void ScriptDebugServer::setPauseOnNextStatement(bool pause)
</ins><span class="cx"> {
</span><del>-    if (!m_pausedPage)
</del><ins>+    if (m_pausedPage)
+        return;
+    if (pause)
</ins><span class="cx">         v8::Debug::DebugBreak();
</span><ins>+    else
+        v8::Debug::CancelDebugBreak();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void ScriptDebugServer::breakProgram()
</span></span></pre></div>
<a id="trunkWebCorebindingsv8ScriptDebugServerh"></a>
<div class="modfile"><h4>Modified: trunk/WebCore/bindings/v8/ScriptDebugServer.h (69013 => 69014)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/bindings/v8/ScriptDebugServer.h        2010-10-04 14:28:46 UTC (rev 69013)
+++ trunk/WebCore/bindings/v8/ScriptDebugServer.h        2010-10-04 14:52:38 UTC (rev 69014)
</span><span class="lines">@@ -70,7 +70,7 @@
</span><span class="cx">     PauseOnExceptionsState pauseOnExceptionsState();
</span><span class="cx">     void setPauseOnExceptionsState(PauseOnExceptionsState pauseOnExceptionsState);
</span><span class="cx"> 
</span><del>-    void pause();
</del><ins>+    void setPauseOnNextStatement(bool pause);
</ins><span class="cx">     void breakProgram();
</span><span class="cx">     void continueProgram();
</span><span class="cx">     void stepIntoStatement();
</span></span></pre></div>
<a id="trunkWebCoredomNodecpp"></a>
<div class="modfile"><h4>Modified: trunk/WebCore/dom/Node.cpp (69013 => 69014)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/dom/Node.cpp        2010-10-04 14:28:46 UTC (rev 69013)
+++ trunk/WebCore/dom/Node.cpp        2010-10-04 14:52:38 UTC (rev 69014)
</span><span class="lines">@@ -53,7 +53,7 @@
</span><span class="cx"> #include &quot;Frame.h&quot;
</span><span class="cx"> #include &quot;FrameView.h&quot;
</span><span class="cx"> #include &quot;HTMLNames.h&quot;
</span><del>-#include &quot;InspectorTimelineAgent.h&quot;
</del><ins>+#include &quot;InspectorInstrumentation.h&quot;
</ins><span class="cx"> #include &quot;KeyboardEvent.h&quot;
</span><span class="cx"> #include &quot;LabelsNodeList.h&quot;
</span><span class="cx"> #include &quot;Logging.h&quot;
</span><span class="lines">@@ -2577,23 +2577,6 @@
</span><span class="cx">     return dispatchGenericEvent(event.release());
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-static bool eventHasListeners(const AtomicString&amp; eventType, DOMWindow* window, Node* node, Vector&lt;RefPtr&lt;ContainerNode&gt; &gt;&amp; ancestors)
-{
-    if (window &amp;&amp; window-&gt;hasEventListeners(eventType))
-        return true;
-
-    if (node-&gt;hasEventListeners(eventType))
-        return true;
-
-    for (size_t i = 0; i &lt; ancestors.size(); i++) {
-        ContainerNode* ancestor = ancestors[i].get();
-        if (ancestor-&gt;hasEventListeners(eventType))
-            return true;
-    }
-
-   return false;    
-}
-
</del><span class="cx"> bool Node::dispatchGenericEvent(PassRefPtr&lt;Event&gt; prpEvent)
</span><span class="cx"> {
</span><span class="cx">     RefPtr&lt;Event&gt; event(prpEvent);
</span><span class="lines">@@ -2619,15 +2602,7 @@
</span><span class="cx">             targetForWindowEvents = static_cast&lt;Document*&gt;(topLevelContainer)-&gt;domWindow();
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-#if ENABLE(INSPECTOR)
-    Page* inspectedPage = InspectorTimelineAgent::instanceCount() ? document()-&gt;page() : 0;
-    if (inspectedPage) {
-        if (InspectorTimelineAgent* timelineAgent = eventHasListeners(event-&gt;type(), targetForWindowEvents, this, ancestors) ? inspectedPage-&gt;inspectorTimelineAgent() : 0)
-            timelineAgent-&gt;willDispatchEvent(*event);
-        else
-            inspectedPage = 0;
-    }
-#endif
</del><ins>+    int instrumentationCookie = InspectorInstrumentation::instrumentWillDispatchEvent(document(), *event, targetForWindowEvents, this, ancestors);
</ins><span class="cx"> 
</span><span class="cx">     // Give the target node a chance to do some work before DOM event handlers get a crack.
</span><span class="cx">     void* data = preDispatchEventHandler(event.get());
</span><span class="lines">@@ -2709,12 +2684,9 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx"> doneWithDefault:
</span><del>-#if ENABLE(INSPECTOR)
-    if (inspectedPage)
-        if (InspectorTimelineAgent* timelineAgent = inspectedPage-&gt;inspectorTimelineAgent())
-            timelineAgent-&gt;didDispatchEvent();
-#endif
</del><span class="cx"> 
</span><ins>+    InspectorInstrumentation::instrumentDidDispatchEvent(document(), instrumentationCookie);
+
</ins><span class="cx">     return !event-&gt;defaultPrevented();
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkWebCoreinspectorInspectorControllercpp"></a>
<div class="modfile"><h4>Modified: trunk/WebCore/inspector/InspectorController.cpp (69013 => 69014)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/inspector/InspectorController.cpp        2010-10-04 14:28:46 UTC (rev 69013)
+++ trunk/WebCore/inspector/InspectorController.cpp        2010-10-04 14:52:38 UTC (rev 69014)
</span><span class="lines">@@ -132,6 +132,9 @@
</span><span class="cx"> 
</span><span class="cx"> static const char* const inspectorAttachedHeightName = &quot;inspectorAttachedHeight&quot;;
</span><span class="cx"> 
</span><ins>+static const char* const xhrNativeBreakpointType = &quot;XHR&quot;;
+static const char* const eventListenerNativeBreakpointType = &quot;EventListener&quot;;
+
</ins><span class="cx"> const char* const InspectorController::ElementsPanel = &quot;elements&quot;;
</span><span class="cx"> const char* const InspectorController::ConsolePanel = &quot;console&quot;;
</span><span class="cx"> const char* const InspectorController::ScriptsPanel = &quot;scripts&quot;;
</span><span class="lines">@@ -778,15 +781,22 @@
</span><span class="cx"> 
</span><span class="cx">         m_times.clear();
</span><span class="cx">         m_counts.clear();
</span><ins>+
</ins><span class="cx"> #if ENABLE(JAVASCRIPT_DEBUGGER)
</span><span class="cx">         if (m_debuggerAgent)
</span><span class="cx">             m_debuggerAgent-&gt;clearForPageNavigation();
</span><span class="cx"> 
</span><ins>+        m_nativeBreakpoints.clear();
+        m_eventListenerBreakpoints.clear();
+        m_eventNameToBreakpointCount.clear();
</ins><span class="cx">         m_XHRBreakpoints.clear();
</span><ins>+        m_lastBreakpointId = 0;
</ins><span class="cx"> #endif
</span><ins>+
</ins><span class="cx"> #if ENABLE(JAVASCRIPT_DEBUGGER) &amp;&amp; USE(JSC)
</span><span class="cx">         m_profilerAgent-&gt;resetState();
</span><span class="cx"> #endif
</span><ins>+
</ins><span class="cx">         // unbindAllResources should be called before database and DOM storage
</span><span class="cx">         // resources are cleared so that it has a chance to unbind them.
</span><span class="cx">         unbindAllResources();
</span><span class="lines">@@ -1675,23 +1685,59 @@
</span><span class="cx">     String type;
</span><span class="cx">     if (!breakpoint-&gt;getString(&quot;type&quot;, &amp;type))
</span><span class="cx">         return;
</span><del>-    if (type == &quot;XHR&quot;) {
-        RefPtr&lt;InspectorObject&gt; condition = breakpoint-&gt;getObject(&quot;condition&quot;);
-        if (!condition)
-            return;
</del><ins>+    RefPtr&lt;InspectorObject&gt; condition = breakpoint-&gt;getObject(&quot;condition&quot;);
+    if (!condition)
+        return;
+    if (type == xhrNativeBreakpointType) {
</ins><span class="cx">         String url;
</span><span class="cx">         if (!condition-&gt;getString(&quot;url&quot;, &amp;url))
</span><span class="cx">             return;
</span><span class="cx">         *breakpointId = ++m_lastBreakpointId;
</span><ins>+        m_nativeBreakpoints.set(*breakpointId, &quot;XHR&quot;);
</ins><span class="cx">         m_XHRBreakpoints.set(*breakpointId, url);
</span><ins>+    } else if (type == eventListenerNativeBreakpointType) {
+        String eventName;
+        if (!condition-&gt;getString(&quot;eventName&quot;, &amp;eventName))
+            return;
+        *breakpointId = ++m_lastBreakpointId;
+        m_nativeBreakpoints.set(*breakpointId, &quot;EventListener&quot;);
+        m_eventListenerBreakpoints.set(*breakpointId, eventName);
+        HashMap&lt;String, unsigned int&gt;::iterator it = m_eventNameToBreakpointCount.find(eventName);
+        if (it == m_eventNameToBreakpointCount.end())
+            m_eventNameToBreakpointCount.set(eventName, 1);
+        else
+            it-&gt;second += 1;
</ins><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void InspectorController::removeNativeBreakpoint(unsigned int breakpointId)
</span><span class="cx"> {
</span><del>-    m_XHRBreakpoints.remove(breakpointId);
</del><ins>+    String type = m_nativeBreakpoints.take(breakpointId);
+    if (type == xhrNativeBreakpointType)
+        m_XHRBreakpoints.remove(breakpointId);
+    else if (type == eventListenerNativeBreakpointType) {
+        String eventName = m_eventListenerBreakpoints.take(breakpointId);
+        HashMap&lt;String, unsigned int&gt;::iterator it = m_eventNameToBreakpointCount.find(eventName);
+        it-&gt;second -= 1;
+        if (!it-&gt;second)
+            m_eventNameToBreakpointCount.remove(it);
+    }
</ins><span class="cx"> }
</span><span class="cx"> 
</span><ins>+bool InspectorController::shouldBreakOnEvent(const String&amp; eventName)
+{
+    return m_eventNameToBreakpointCount.contains(eventName);
+}
+
+bool InspectorController::shouldBreakOnXMLHttpRequest(const String&amp; url)
+{
+    for (HashMap&lt;unsigned int, String&gt;::iterator it = m_XHRBreakpoints.begin(); it != m_XHRBreakpoints.end(); ++it) {
+        if (url.contains(it-&gt;second))
+            return true;
+    }
+    return false;
+}
+
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> void InspectorController::evaluateForTestInFrontend(long callId, const String&amp; script)
</span><span class="lines">@@ -2100,26 +2146,6 @@
</span><span class="cx">     m_inspectedPage-&gt;mainFrame()-&gt;redirectScheduler()-&gt;scheduleRefresh(true);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void InspectorController::instrumentWillSendXMLHttpRequest(const KURL&amp; url)
-{
-#if ENABLE(JAVASCRIPT_DEBUGGER)
-    if (m_debuggerAgent) {
-        if (!m_XHRBreakpoints.size())
-            return;
-        for (HashMap&lt;unsigned int, String&gt;::iterator it = m_XHRBreakpoints.begin(); it != m_XHRBreakpoints.end(); ++it) {
-            if (!url.string().contains(it-&gt;second))
-                continue;
-            RefPtr&lt;InspectorObject&gt; eventData = InspectorObject::create();
-            eventData-&gt;setString(&quot;type&quot;, &quot;XHR&quot;);
-            eventData-&gt;setString(&quot;url&quot;, url);
-            m_debuggerAgent-&gt;breakProgram(NativeBreakpointDebuggerEventType, eventData);
-            break;
-        }
-    }
-#endif
-}
-
-
</del><span class="cx"> } // namespace WebCore
</span><span class="cx"> 
</span><span class="cx"> #endif // ENABLE(INSPECTOR)
</span></span></pre></div>
<a id="trunkWebCoreinspectorInspectorControllerh"></a>
<div class="modfile"><h4>Modified: trunk/WebCore/inspector/InspectorController.h (69013 => 69014)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/inspector/InspectorController.h        2010-10-04 14:28:46 UTC (rev 69013)
+++ trunk/WebCore/inspector/InspectorController.h        2010-10-04 14:52:38 UTC (rev 69014)
</span><span class="lines">@@ -261,7 +261,6 @@
</span><span class="cx"> 
</span><span class="cx">     void setNativeBreakpoint(PassRefPtr&lt;InspectorObject&gt; breakpoint, unsigned int* breakpointId);
</span><span class="cx">     void removeNativeBreakpoint(unsigned int breakpointId);
</span><del>-
</del><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx">     void evaluateForTestInFrontend(long testCallId, const String&amp; script);
</span><span class="lines">@@ -298,9 +297,11 @@
</span><span class="cx">     void releaseFrontendLifetimeAgents();
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(JAVASCRIPT_DEBUGGER)
</span><del>-
</del><span class="cx">     void toggleRecordButton(bool);
</span><span class="cx">     void enableDebuggerFromFrontend(bool always);
</span><ins>+
+    bool shouldBreakOnEvent(const String&amp; eventName);
+    bool shouldBreakOnXMLHttpRequest(const String&amp;);
</ins><span class="cx"> #endif
</span><span class="cx"> #if ENABLE(DATABASE)
</span><span class="cx">     void selectDatabase(Database* database);
</span><span class="lines">@@ -329,8 +330,6 @@
</span><span class="cx"> 
</span><span class="cx">     void didEvaluateForTestInFrontend(long callId, const String&amp; jsonResult);
</span><span class="cx"> 
</span><del>-    void instrumentWillSendXMLHttpRequest(const KURL&amp;);
-
</del><span class="cx"> #if ENABLE(JAVASCRIPT_DEBUGGER)
</span><span class="cx">     friend class InspectorDebuggerAgent;
</span><span class="cx">     String breakpointsSettingKey();
</span><span class="lines">@@ -392,6 +391,9 @@
</span><span class="cx">     bool m_attachDebuggerWhenShown;
</span><span class="cx">     OwnPtr&lt;InspectorDebuggerAgent&gt; m_debuggerAgent;
</span><span class="cx"> 
</span><ins>+    HashMap&lt;unsigned int, String&gt; m_nativeBreakpoints;
+    HashMap&lt;unsigned int, String&gt; m_eventListenerBreakpoints;
+    HashMap&lt;String, unsigned int&gt; m_eventNameToBreakpointCount;
</ins><span class="cx">     HashMap&lt;unsigned int, String&gt; m_XHRBreakpoints;
</span><span class="cx">     unsigned int m_lastBreakpointId;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkWebCoreinspectorInspectorDebuggerAgentcpp"></a>
<div class="modfile"><h4>Modified: trunk/WebCore/inspector/InspectorDebuggerAgent.cpp (69013 => 69014)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/inspector/InspectorDebuggerAgent.cpp        2010-10-04 14:28:46 UTC (rev 69013)
+++ trunk/WebCore/inspector/InspectorDebuggerAgent.cpp        2010-10-04 14:52:38 UTC (rev 69014)
</span><span class="lines">@@ -57,8 +57,6 @@
</span><span class="cx">     return agent.release();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-InspectorDebuggerAgent* InspectorDebuggerAgent::s_debuggerAgentOnBreakpoint = 0;
-
</del><span class="cx"> InspectorDebuggerAgent::InspectorDebuggerAgent(InspectorController* inspectorController, InspectorFrontend* frontend)
</span><span class="cx">     : m_inspectorController(inspectorController)
</span><span class="cx">     , m_frontend(frontend)
</span><span class="lines">@@ -71,9 +69,6 @@
</span><span class="cx"> {
</span><span class="cx">     ScriptDebugServer::shared().removeListener(this, m_inspectorController-&gt;inspectedPage());
</span><span class="cx">     m_pausedScriptState = 0;
</span><del>-
-    if (this == s_debuggerAgentOnBreakpoint)
-        s_debuggerAgentOnBreakpoint = 0;
</del><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> bool InspectorDebuggerAgent::isDebuggerAlwaysEnabled()
</span><span class="lines">@@ -147,9 +142,23 @@
</span><span class="cx">     *scriptSource = m_scriptIDToContent.get(sourceID);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void InspectorDebuggerAgent::schedulePauseOnNextStatement(DebuggerEventType type, PassRefPtr&lt;InspectorValue&gt; data)
+{
+    m_breakProgramDetails = InspectorObject::create();
+    m_breakProgramDetails-&gt;setNumber(&quot;eventType&quot;, type);
+    m_breakProgramDetails-&gt;setValue(&quot;eventData&quot;, data);
+    ScriptDebugServer::shared().setPauseOnNextStatement(true);
+}
+
+void InspectorDebuggerAgent::cancelPauseOnNextStatement()
+{
+    m_breakProgramDetails = 0;
+    ScriptDebugServer::shared().setPauseOnNextStatement(false);
+}
+
</ins><span class="cx"> void InspectorDebuggerAgent::pause()
</span><span class="cx"> {
</span><del>-    ScriptDebugServer::shared().pause();
</del><ins>+    schedulePauseOnNextStatement(JavaScriptPauseEventType, InspectorObject::create());
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void InspectorDebuggerAgent::resume()
</span><span class="lines">@@ -305,6 +314,7 @@
</span><span class="cx"> void InspectorDebuggerAgent::didContinue()
</span><span class="cx"> {
</span><span class="cx">     m_pausedScriptState = 0;
</span><ins>+    m_breakProgramDetails = 0;
</ins><span class="cx">     m_frontend-&gt;resumedScript();
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -313,14 +323,7 @@
</span><span class="cx">     m_breakProgramDetails = InspectorObject::create();
</span><span class="cx">     m_breakProgramDetails-&gt;setNumber(&quot;eventType&quot;, type);
</span><span class="cx">     m_breakProgramDetails-&gt;setValue(&quot;eventData&quot;, data);
</span><del>-    s_debuggerAgentOnBreakpoint = this;
-
</del><span class="cx">     ScriptDebugServer::shared().breakProgram();
</span><del>-    if (!s_debuggerAgentOnBreakpoint)
-        return;
-
-    s_debuggerAgentOnBreakpoint = 0;
-    m_breakProgramDetails = 0;
</del><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkWebCoreinspectorInspectorDebuggerAgenth"></a>
<div class="modfile"><h4>Modified: trunk/WebCore/inspector/InspectorDebuggerAgent.h (69013 => 69014)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/inspector/InspectorDebuggerAgent.h        2010-10-04 14:28:46 UTC (rev 69013)
+++ trunk/WebCore/inspector/InspectorDebuggerAgent.h        2010-10-04 14:52:38 UTC (rev 69014)
</span><span class="lines">@@ -47,6 +47,7 @@
</span><span class="cx"> class InspectorValue;
</span><span class="cx"> 
</span><span class="cx"> enum DebuggerEventType {
</span><ins>+    JavaScriptPauseEventType,
</ins><span class="cx">     DOMBreakpointDebuggerEventType,
</span><span class="cx">     NativeBreakpointDebuggerEventType
</span><span class="cx"> };
</span><span class="lines">@@ -66,8 +67,10 @@
</span><span class="cx">     void editScriptSource(const String&amp; sourceID, const String&amp; newContent, bool* success, String* result, RefPtr&lt;InspectorValue&gt;* newCallFrames);
</span><span class="cx">     void getScriptSource(const String&amp; sourceID, String* scriptSource);
</span><span class="cx"> 
</span><ins>+    void schedulePauseOnNextStatement(DebuggerEventType type, PassRefPtr&lt;InspectorValue&gt; data);
+    void cancelPauseOnNextStatement();
+    void breakProgram(DebuggerEventType type, PassRefPtr&lt;InspectorValue&gt; data);
</ins><span class="cx">     void pause();
</span><del>-    void breakProgram(DebuggerEventType type, PassRefPtr&lt;InspectorValue&gt; data);
</del><span class="cx">     void resume();
</span><span class="cx">     void stepOverStatement();
</span><span class="cx">     void stepIntoStatement();
</span></span></pre></div>
<a id="trunkWebCoreinspectorInspectorInstrumentationcpp"></a>
<div class="modfile"><h4>Modified: trunk/WebCore/inspector/InspectorInstrumentation.cpp (69013 => 69014)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/inspector/InspectorInstrumentation.cpp        2010-10-04 14:28:46 UTC (rev 69013)
+++ trunk/WebCore/inspector/InspectorInstrumentation.cpp        2010-10-04 14:52:38 UTC (rev 69014)
</span><span class="lines">@@ -33,14 +33,34 @@
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(INSPECTOR)
</span><span class="cx"> 
</span><ins>+#include &quot;DOMWindow.h&quot;
+#include &quot;Event.h&quot;
</ins><span class="cx"> #include &quot;InspectorController.h&quot;
</span><span class="cx"> #include &quot;InspectorDOMAgent.h&quot;
</span><span class="cx"> #include &quot;InspectorDebuggerAgent.h&quot;
</span><ins>+#include &quot;InspectorTimelineAgent.h&quot;
</ins><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><span class="cx"> int InspectorInstrumentation::s_frontendCounter = 0;
</span><span class="cx"> 
</span><ins>+static bool eventHasListeners(const AtomicString&amp; eventType, DOMWindow* window, Node* node, const Vector&lt;RefPtr&lt;ContainerNode&gt; &gt;&amp; ancestors)
+{
+    if (window &amp;&amp; window-&gt;hasEventListeners(eventType))
+        return true;
+
+    if (node-&gt;hasEventListeners(eventType))
+        return true;
+
+    for (size_t i = 0; i &lt; ancestors.size(); i++) {
+        ContainerNode* ancestor = ancestors[i].get();
+        if (ancestor-&gt;hasEventListeners(eventType))
+            return true;
+    }
+
+    return false;
+}
+
</ins><span class="cx"> void InspectorInstrumentation::willInsertDOMNodeImpl(InspectorController* inspectorController, Node* node, Node* parent)
</span><span class="cx"> {
</span><span class="cx"> #if ENABLE(JAVASCRIPT_DEBUGGER)
</span><span class="lines">@@ -124,13 +144,67 @@
</span><span class="cx">         domAgent-&gt;characterDataModified(characterData);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void InspectorInstrumentation::instrumentWillSendXMLHttpRequestImpl(InspectorController* inspectorController, const KURL&amp; url)
</del><ins>+int InspectorInstrumentation::instrumentWillDispatchEventImpl(InspectorController* inspectorController, const Event&amp; event, DOMWindow* window, Node* node, const Vector&lt;RefPtr&lt;ContainerNode&gt; &gt;&amp; ancestors)
</ins><span class="cx"> {
</span><ins>+    int instrumentationCookie = 0;
+
</ins><span class="cx">     if (!inspectorController-&gt;hasFrontend())
</span><ins>+        return instrumentationCookie;
+
+#if ENABLE(JAVASCRIPT_DEBUGGER)
+    if (InspectorDebuggerAgent* debuggerAgent = inspectorController-&gt;m_debuggerAgent.get()) {
+        if (inspectorController-&gt;shouldBreakOnEvent(event.type())) {
+            RefPtr&lt;InspectorObject&gt; eventData = InspectorObject::create();
+            eventData-&gt;setString(&quot;type&quot;, &quot;EventListener&quot;);
+            eventData-&gt;setString(&quot;eventName&quot;, event.type());
+            debuggerAgent-&gt;schedulePauseOnNextStatement(NativeBreakpointDebuggerEventType, eventData);
+        }
+    }
+#endif
+
+    InspectorTimelineAgent* timelineAgent = inspectorController-&gt;m_timelineAgent.get();
+    if (timelineAgent &amp;&amp; eventHasListeners(event.type(), window, node, ancestors)) {
+        timelineAgent-&gt;willDispatchEvent(event);
+        instrumentationCookie = timelineAgent-&gt;id();
+    }
+    return instrumentationCookie;
+}
+
+void InspectorInstrumentation::instrumentDidDispatchEventImpl(InspectorController* inspectorController, int instrumentationCookie)
+{
+    if (!inspectorController-&gt;hasFrontend())
</ins><span class="cx">         return;
</span><del>-    inspectorController-&gt;instrumentWillSendXMLHttpRequest(url);
</del><ins>+
+#if ENABLE(JAVASCRIPT_DEBUGGER)
+    if (InspectorDebuggerAgent* debuggerAgent = inspectorController-&gt;m_debuggerAgent.get())
+        debuggerAgent-&gt;cancelPauseOnNextStatement();
+#endif
+
+    InspectorTimelineAgent* timelineAgent = inspectorController-&gt;m_timelineAgent.get();
+    if (timelineAgent &amp;&amp; timelineAgent-&gt;id() == instrumentationCookie)
+        timelineAgent-&gt;didDispatchEvent();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void InspectorInstrumentation::instrumentWillSendXMLHttpRequestImpl(InspectorController* inspectorController, const String&amp; url)
+{
+#if ENABLE(JAVASCRIPT_DEBUGGER)
+    if (!inspectorController-&gt;hasFrontend())
+        return;
+
+    InspectorDebuggerAgent* debuggerAgent = inspectorController-&gt;m_debuggerAgent.get();
+    if (!debuggerAgent)
+        return;
+
+    if (!inspectorController-&gt;shouldBreakOnXMLHttpRequest(url))
+        return;
+
+    RefPtr&lt;InspectorObject&gt; eventData = InspectorObject::create();
+    eventData-&gt;setString(&quot;type&quot;, &quot;XHR&quot;);
+    eventData-&gt;setString(&quot;url&quot;, url);
+    debuggerAgent-&gt;breakProgram(NativeBreakpointDebuggerEventType, eventData);
+#endif
+}
+
</ins><span class="cx"> } // namespace WebCore
</span><span class="cx"> 
</span><span class="cx"> #endif // !ENABLE(INSPECTOR)
</span></span></pre></div>
<a id="trunkWebCoreinspectorInspectorInstrumentationh"></a>
<div class="modfile"><h4>Modified: trunk/WebCore/inspector/InspectorInstrumentation.h (69013 => 69014)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/inspector/InspectorInstrumentation.h        2010-10-04 14:28:46 UTC (rev 69013)
+++ trunk/WebCore/inspector/InspectorInstrumentation.h        2010-10-04 14:52:38 UTC (rev 69014)
</span><span class="lines">@@ -40,7 +40,6 @@
</span><span class="cx"> class CharacterData;
</span><span class="cx"> class Element;
</span><span class="cx"> class InspectorController;
</span><del>-class KURL;
</del><span class="cx"> class Node;
</span><span class="cx"> 
</span><span class="cx"> class InspectorInstrumentation {
</span><span class="lines">@@ -52,8 +51,11 @@
</span><span class="cx">     static void didModifyDOMAttr(Document*, Element*);
</span><span class="cx">     static void characterDataModified(Document*, CharacterData*);
</span><span class="cx"> 
</span><del>-    static void instrumentWillSendXMLHttpRequest(ScriptExecutionContext*, const KURL&amp;);
</del><ins>+    static int instrumentWillDispatchEvent(Document*, const Event&amp;, DOMWindow*, Node*, const Vector&lt;RefPtr&lt;ContainerNode&gt; &gt;&amp; ancestors);
+    static void instrumentDidDispatchEvent(Document*, int instrumentationCookie);
</ins><span class="cx"> 
</span><ins>+    static void instrumentWillSendXMLHttpRequest(ScriptExecutionContext*, const String&amp;);
+
</ins><span class="cx"> #if ENABLE(INSPECTOR)
</span><span class="cx">     static void frontendCreated() { s_frontendCounter += 1; }
</span><span class="cx">     static void frontendDeleted() { s_frontendCounter -= 1; }
</span><span class="lines">@@ -70,8 +72,11 @@
</span><span class="cx">     static void didModifyDOMAttrImpl(InspectorController*, Element*);
</span><span class="cx">     static void characterDataModifiedImpl(InspectorController*, CharacterData*);
</span><span class="cx"> 
</span><del>-    static void instrumentWillSendXMLHttpRequestImpl(InspectorController*, const KURL&amp;);
</del><ins>+    static int instrumentWillDispatchEventImpl(InspectorController*, const Event&amp;, DOMWindow*, Node*, const Vector&lt;RefPtr&lt;ContainerNode&gt; &gt;&amp; ancestors);
+    static void instrumentDidDispatchEventImpl(InspectorController*, int instrumentationCookie);
</ins><span class="cx"> 
</span><ins>+    static void instrumentWillSendXMLHttpRequestImpl(InspectorController*, const String&amp;);
+
</ins><span class="cx">     static InspectorController* inspectorControllerForScriptExecutionContext(ScriptExecutionContext*);
</span><span class="cx">     static InspectorController* inspectorControllerForDocument(Document*);
</span><span class="cx">     static InspectorController* inspectorControllerForPage(Page*);
</span><span class="lines">@@ -130,9 +135,26 @@
</span><span class="cx"> #endif
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-inline void InspectorInstrumentation::instrumentWillSendXMLHttpRequest(ScriptExecutionContext* context, const KURL&amp; url)
</del><ins>+inline int InspectorInstrumentation::instrumentWillDispatchEvent(Document* document, const Event&amp; event, DOMWindow* window, Node* node, const Vector&lt;RefPtr&lt;ContainerNode&gt; &gt;&amp; ancestors)
</ins><span class="cx"> {
</span><span class="cx"> #if ENABLE(INSPECTOR)
</span><ins>+    if (InspectorController* inspectorController = inspectorControllerForDocument(document))
+        return instrumentWillDispatchEventImpl(inspectorController, event, window, node, ancestors);
+#endif
+    return 0;
+}
+
+inline void InspectorInstrumentation::instrumentDidDispatchEvent(Document* document, int instrumentationCookie)
+{
+#if ENABLE(INSPECTOR)
+    if (InspectorController* inspectorController = inspectorControllerForDocument(document))
+        instrumentDidDispatchEventImpl(inspectorController, instrumentationCookie);
+#endif
+}
+
+inline void InspectorInstrumentation::instrumentWillSendXMLHttpRequest(ScriptExecutionContext* context, const String&amp; url)
+{
+#if ENABLE(INSPECTOR)
</ins><span class="cx">     if (InspectorController* inspectorController = inspectorControllerForScriptExecutionContext(context))
</span><span class="cx">         instrumentWillSendXMLHttpRequestImpl(inspectorController, url);
</span><span class="cx"> #endif
</span></span></pre></div>
<a id="trunkWebCoreinspectorInspectorTimelineAgentcpp"></a>
<div class="modfile"><h4>Modified: trunk/WebCore/inspector/InspectorTimelineAgent.cpp (69013 => 69014)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/inspector/InspectorTimelineAgent.cpp        2010-10-04 14:28:46 UTC (rev 69013)
+++ trunk/WebCore/inspector/InspectorTimelineAgent.cpp        2010-10-04 14:52:38 UTC (rev 69014)
</span><span class="lines">@@ -45,9 +45,11 @@
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><span class="cx"> int InspectorTimelineAgent::s_instanceCount = 0;
</span><ins>+int InspectorTimelineAgent::s_id = 0;
</ins><span class="cx"> 
</span><span class="cx"> InspectorTimelineAgent::InspectorTimelineAgent(InspectorFrontend* frontend)
</span><span class="cx">     : m_frontend(frontend)
</span><ins>+    , m_id(++s_id)
</ins><span class="cx"> {
</span><span class="cx">     ++s_instanceCount;
</span><span class="cx">     ScriptGCEvent::addEventListener(this);
</span></span></pre></div>
<a id="trunkWebCoreinspectorInspectorTimelineAgenth"></a>
<div class="modfile"><h4>Modified: trunk/WebCore/inspector/InspectorTimelineAgent.h (69013 => 69014)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/inspector/InspectorTimelineAgent.h        2010-10-04 14:28:46 UTC (rev 69013)
+++ trunk/WebCore/inspector/InspectorTimelineAgent.h        2010-10-04 14:52:38 UTC (rev 69014)
</span><span class="lines">@@ -77,6 +77,8 @@
</span><span class="cx">     InspectorTimelineAgent(InspectorFrontend* frontend);
</span><span class="cx">     ~InspectorTimelineAgent();
</span><span class="cx"> 
</span><ins>+    int id() const { return m_id; }
+
</ins><span class="cx">     void reset();
</span><span class="cx">     void resetFrontendProxyObject(InspectorFrontend*);
</span><span class="cx"> 
</span><span class="lines">@@ -156,6 +158,8 @@
</span><span class="cx"> 
</span><span class="cx">     Vector&lt;TimelineRecordEntry&gt; m_recordStack;
</span><span class="cx">     static int s_instanceCount;
</span><ins>+    static int s_id;
+    const int m_id;
</ins><span class="cx">     struct GCEvent {
</span><span class="cx">         GCEvent(double startTime, double endTime, size_t collectedBytes)
</span><span class="cx">             : startTime(startTime), endTime(endTime), collectedBytes(collectedBytes)
</span></span></pre></div>
<a id="trunkWebCoreinspectorfrontendCallStackSidebarPanejs"></a>
<div class="modfile"><h4>Modified: trunk/WebCore/inspector/front-end/CallStackSidebarPane.js (69013 => 69014)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/inspector/front-end/CallStackSidebarPane.js        2010-10-04 14:28:46 UTC (rev 69013)
+++ trunk/WebCore/inspector/front-end/CallStackSidebarPane.js        2010-10-04 14:52:38 UTC (rev 69014)
</span><span class="lines">@@ -29,8 +29,9 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> WebInspector.CallStackSidebarPane.DebuggerEventType = {
</span><del>-    DOMBreakpoint: 0,
-    NativeBreakpoint: 1
</del><ins>+    JavaScriptPause: 0,
+    DOMBreakpoint: 1,
+    NativeBreakpoint: 2
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> WebInspector.CallStackSidebarPane.prototype = {
</span></span></pre>
</div>
</div>

</body>
</html>