<!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>[161761] trunk/Source/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/161761">161761</a></dd>
<dt>Author</dt> <dd>commit-queue@webkit.org</dd>
<dt>Date</dt> <dd>2014-01-11 07:51:31 -0800 (Sat, 11 Jan 2014)</dd>
</dl>

<h3>Log Message</h3>
<pre>Web Inspector: Some ScriptDebugServer Cleanup
https://bugs.webkit.org/show_bug.cgi?id=126793

Patch by Joseph Pecoraro &lt;pecoraro@apple.com&gt; on 2014-01-11
Reviewed by Timothy Hatcher.

* bindings/js/PageScriptDebugServer.cpp:
(WebCore::PageScriptDebugServer::didContinue):
(WebCore::PageScriptDebugServer::runEventLoopWhilePaused):
Move the special iOS WebThread EventLoop nesting handling here.

* bindings/js/ScriptDebugServer.cpp:
(WebCore::ScriptDebugServer::ScriptDebugServer):
(WebCore::ScriptDebugServer::handlePause):
* bindings/js/ScriptDebugServer.h:
* inspector/InspectorDebuggerAgent.cpp:
* inspector/InspectorDebuggerAgent.h:
Remove unused headers and functions.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCorebindingsjsPageScriptDebugServercpp">trunk/Source/WebCore/bindings/js/PageScriptDebugServer.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsjsScriptDebugServercpp">trunk/Source/WebCore/bindings/js/ScriptDebugServer.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsjsScriptDebugServerh">trunk/Source/WebCore/bindings/js/ScriptDebugServer.h</a></li>
<li><a href="#trunkSourceWebCoreinspectorInspectorDebuggerAgentcpp">trunk/Source/WebCore/inspector/InspectorDebuggerAgent.cpp</a></li>
<li><a href="#trunkSourceWebCoreinspectorInspectorDebuggerAgenth">trunk/Source/WebCore/inspector/InspectorDebuggerAgent.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (161760 => 161761)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2014-01-11 14:17:12 UTC (rev 161760)
+++ trunk/Source/WebCore/ChangeLog        2014-01-11 15:51:31 UTC (rev 161761)
</span><span class="lines">@@ -1,3 +1,23 @@
</span><ins>+2014-01-11  Joseph Pecoraro  &lt;pecoraro@apple.com&gt;
+
+        Web Inspector: Some ScriptDebugServer Cleanup
+        https://bugs.webkit.org/show_bug.cgi?id=126793
+
+        Reviewed by Timothy Hatcher.
+
+        * bindings/js/PageScriptDebugServer.cpp:
+        (WebCore::PageScriptDebugServer::didContinue):
+        (WebCore::PageScriptDebugServer::runEventLoopWhilePaused):
+        Move the special iOS WebThread EventLoop nesting handling here.
+
+        * bindings/js/ScriptDebugServer.cpp:
+        (WebCore::ScriptDebugServer::ScriptDebugServer):
+        (WebCore::ScriptDebugServer::handlePause):
+        * bindings/js/ScriptDebugServer.h:
+        * inspector/InspectorDebuggerAgent.cpp:
+        * inspector/InspectorDebuggerAgent.h:
+        Remove unused headers and functions.
+
</ins><span class="cx"> 2014-01-11  David Kilzer  &lt;ddkilzer@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [iOS] Add USE(IOSURFACE_CANVAS_BACKING_STORE) to fix build
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsPageScriptDebugServercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/PageScriptDebugServer.cpp (161760 => 161761)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/PageScriptDebugServer.cpp        2014-01-11 14:17:12 UTC (rev 161760)
+++ trunk/Source/WebCore/bindings/js/PageScriptDebugServer.cpp        2014-01-11 15:51:31 UTC (rev 161761)
</span><span class="lines">@@ -52,6 +52,11 @@
</span><span class="cx"> #include &lt;wtf/PassOwnPtr.h&gt;
</span><span class="cx"> #include &lt;wtf/StdLibExtras.h&gt;
</span><span class="cx"> 
</span><ins>+#if PLATFORM(IOS)
+#include &quot;JSDOMWindowBase.h&quot;
+#include &quot;WebCoreThreadInternal.h&quot;
+#endif
+
</ins><span class="cx"> using namespace JSC;
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="lines">@@ -148,11 +153,6 @@
</span><span class="cx"> {
</span><span class="cx">     // Page can be null if we are continuing because the Page closed.
</span><span class="cx">     Page* page = toPage(globalObject);
</span><del>-#if PLATFORM(IOS)
-    // FIXME: Can this happen in open source too, or is this iOS (multi-threaded) only?
-    if (!page)
-        return;
-#endif
</del><span class="cx">     ASSERT(!page || page == m_pausedPage);
</span><span class="cx"> 
</span><span class="cx">     m_pausedPage = 0;
</span><span class="lines">@@ -174,9 +174,26 @@
</span><span class="cx"> 
</span><span class="cx"> void PageScriptDebugServer::runEventLoopWhilePaused()
</span><span class="cx"> {
</span><ins>+#if PLATFORM(IOS)
+    // On iOS, running an EventLoop causes us to run a nested WebRunLoop.
+    // Since the WebThread is autoreleased at the end of run loop iterations
+    // we need to gracefully handle releasing and reacquiring the lock.
+    ASSERT(WebThreadIsLockedOrDisabled());
+    {
+        if (WebThreadIsEnabled())
+            JSC::JSLock::DropAllLocks dropAllLocks(WebCore::JSDOMWindowBase::commonVM(), JSC::JSLock::DropAllLocks::AlwaysDropLocks);
+        WebRunLoopEnableNested();
+#endif
+
</ins><span class="cx">     EventLoop loop;
</span><span class="cx">     while (!m_doneProcessingDebuggerEvents &amp;&amp; !loop.ended())
</span><span class="cx">         loop.cycle();
</span><ins>+
+#if PLATFORM(IOS)
+        WebRunLoopDisableNested();
+    }
+    ASSERT(WebThreadIsLockedOrDisabled());
+#endif
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void PageScriptDebugServer::setJavaScriptPaused(const PageGroup&amp; pageGroup, bool paused)
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsScriptDebugServercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/ScriptDebugServer.cpp (161760 => 161761)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/ScriptDebugServer.cpp        2014-01-11 14:17:12 UTC (rev 161760)
+++ trunk/Source/WebCore/bindings/js/ScriptDebugServer.cpp        2014-01-11 15:51:31 UTC (rev 161761)
</span><span class="lines">@@ -33,15 +33,11 @@
</span><span class="cx"> 
</span><span class="cx"> #include &quot;ScriptDebugServer.h&quot;
</span><span class="cx"> 
</span><del>-#include &quot;ContentSearchUtils.h&quot;
</del><span class="cx"> #include &quot;EventLoop.h&quot;
</span><del>-#include &quot;Frame.h&quot;
</del><span class="cx"> #include &quot;JSDOMWindowCustom.h&quot;
</span><span class="cx"> #include &quot;JSJavaScriptCallFrame.h&quot;
</span><span class="cx"> #include &quot;JavaScriptCallFrame.h&quot;
</span><span class="cx"> #include &quot;PageConsole.h&quot;
</span><del>-#include &quot;ScriptBreakpoint.h&quot;
-#include &quot;ScriptDebugListener.h&quot;
</del><span class="cx"> #include &quot;Sound.h&quot;
</span><span class="cx"> #include &lt;bindings/ScriptValue.h&gt;
</span><span class="cx"> #include &lt;debugger/DebuggerCallFrame.h&gt;
</span><span class="lines">@@ -50,11 +46,6 @@
</span><span class="cx"> #include &lt;wtf/MainThread.h&gt;
</span><span class="cx"> #include &lt;wtf/text/WTFString.h&gt;
</span><span class="cx"> 
</span><del>-#if PLATFORM(IOS)
-#include &quot;JSDOMWindowBase.h&quot;
-#include &quot;WebCoreThreadInternal.h&quot;
-#endif
-
</del><span class="cx"> using namespace JSC;
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="lines">@@ -63,7 +54,6 @@
</span><span class="cx">     : Debugger(isInWorkerThread)
</span><span class="cx">     , m_doneProcessingDebuggerEvents(true)
</span><span class="cx">     , m_callingListeners(false)
</span><del>-    , m_runningNestedMessageLoop(false)
</del><span class="cx">     , m_recompileTimer(this, &amp;ScriptDebugServer::recompileAllJSFunctions)
</span><span class="cx"> {
</span><span class="cx"> }
</span><span class="lines">@@ -283,27 +273,9 @@
</span><span class="cx"> 
</span><span class="cx">     TimerBase::fireTimersInNestedEventLoop();
</span><span class="cx"> 
</span><del>-#if PLATFORM(IOS)
-    // On iOS, running an EventLoop causes us to run a nested WebRunLoop.
-    // Since the WebThread is autoreleased at the end of run loop iterations
-    // we need to gracefully handle releasing and reacquiring the lock.
-    ASSERT(WebThreadIsLockedOrDisabled());
-    {
-        if (WebThreadIsEnabled())
-            JSC::JSLock::DropAllLocks dropAllLocks(WebCore::JSDOMWindowBase::commonVM(), JSC::JSLock::DropAllLocks::AlwaysDropLocks);
-        WebRunLoopEnableNested();
-#endif
-
-    m_runningNestedMessageLoop = true;
</del><span class="cx">     m_doneProcessingDebuggerEvents = false;
</span><span class="cx">     runEventLoopWhilePaused();
</span><del>-    m_runningNestedMessageLoop = false;
</del><span class="cx"> 
</span><del>-#if PLATFORM(IOS)
-        WebRunLoopDisableNested();
-    }
-    ASSERT(WebThreadIsLockedOrDisabled());
-#endif
</del><span class="cx">     didContinue(vmEntryGlobalObject);
</span><span class="cx">     dispatchFunctionToListeners(&amp;ScriptDebugServer::dispatchDidContinue, vmEntryGlobalObject);
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsScriptDebugServerh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/ScriptDebugServer.h (161760 => 161761)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/ScriptDebugServer.h        2014-01-11 14:17:12 UTC (rev 161760)
+++ trunk/Source/WebCore/bindings/js/ScriptDebugServer.h        2014-01-11 15:51:31 UTC (rev 161761)
</span><span class="lines">@@ -62,8 +62,6 @@
</span><span class="cx">     void recompileAllJSFunctionsSoon();
</span><span class="cx">     virtual void recompileAllJSFunctions(Timer&lt;ScriptDebugServer&gt;* = 0) = 0;
</span><span class="cx"> 
</span><del>-    bool runningNestedMessageLoop() { return m_runningNestedMessageLoop; }
-
</del><span class="cx">     class Task {
</span><span class="cx">         WTF_MAKE_FAST_ALLOCATED;
</span><span class="cx">     public:
</span><span class="lines">@@ -95,22 +93,20 @@
</span><span class="cx">     void dispatchDidParseSource(const ListenerSet&amp; listeners, JSC::SourceProvider*, bool isContentScript);
</span><span class="cx">     void dispatchFailedToParseSource(const ListenerSet&amp; listeners, JSC::SourceProvider*, int errorLine, const String&amp; errorMessage);
</span><span class="cx"> 
</span><del>-    virtual void sourceParsed(JSC::ExecState*, JSC::SourceProvider*, int errorLine, const String&amp; errorMsg) OVERRIDE;
-
</del><span class="cx">     bool m_doneProcessingDebuggerEvents;
</span><span class="cx"> 
</span><span class="cx"> private:
</span><span class="cx">     typedef Vector&lt;ScriptBreakpointAction&gt; BreakpointActions;
</span><span class="cx">     typedef HashMap&lt;JSC::BreakpointID, BreakpointActions&gt; BreakpointIDToActionsMap;
</span><span class="cx"> 
</span><del>-    virtual bool needPauseHandling(JSC::JSGlobalObject*) OVERRIDE;
-    virtual void handleBreakpointHit(const JSC::Breakpoint&amp;) OVERRIDE;
-    virtual void handleExceptionInBreakpointCondition(JSC::ExecState*, JSC::JSValue exception) const OVERRIDE;
-    virtual void handlePause(JSC::Debugger::ReasonForPause, JSC::JSGlobalObject*) OVERRIDE;
-    virtual void notifyDoneProcessingDebuggerEvents() OVERRIDE;
</del><ins>+    virtual void sourceParsed(JSC::ExecState*, JSC::SourceProvider*, int errorLine, const String&amp; errorMsg) OVERRIDE FINAL;
+    virtual bool needPauseHandling(JSC::JSGlobalObject*) OVERRIDE FINAL;
+    virtual void handleBreakpointHit(const JSC::Breakpoint&amp;) OVERRIDE FINAL;
+    virtual void handleExceptionInBreakpointCondition(JSC::ExecState*, JSC::JSValue exception) const OVERRIDE FINAL;
+    virtual void handlePause(JSC::Debugger::ReasonForPause, JSC::JSGlobalObject*) OVERRIDE FINAL;
+    virtual void notifyDoneProcessingDebuggerEvents() OVERRIDE FINAL;
</ins><span class="cx"> 
</span><span class="cx">     bool m_callingListeners;
</span><del>-    bool m_runningNestedMessageLoop;
</del><span class="cx">     BreakpointIDToActionsMap m_breakpointIDToActions;
</span><span class="cx">     Timer&lt;ScriptDebugServer&gt; m_recompileTimer;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreinspectorInspectorDebuggerAgentcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/inspector/InspectorDebuggerAgent.cpp (161760 => 161761)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/inspector/InspectorDebuggerAgent.cpp        2014-01-11 14:17:12 UTC (rev 161760)
+++ trunk/Source/WebCore/inspector/InspectorDebuggerAgent.cpp        2014-01-11 15:51:31 UTC (rev 161761)
</span><span class="lines">@@ -149,11 +149,6 @@
</span><span class="cx">     return scriptDebugServer().isPaused();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-bool InspectorDebuggerAgent::runningNestedMessageLoop()
-{
-    return scriptDebugServer().runningNestedMessageLoop();
-}
-
</del><span class="cx"> void InspectorDebuggerAgent::addMessageToConsole(MessageSource source, MessageType type)
</span><span class="cx"> {
</span><span class="cx">     if (scriptDebugServer().pauseOnExceptionsState() != ScriptDebugServer::DontPauseOnExceptions &amp;&amp; source == ConsoleAPIMessageSource &amp;&amp; type == AssertMessageType)
</span></span></pre></div>
<a id="trunkSourceWebCoreinspectorInspectorDebuggerAgenth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/inspector/InspectorDebuggerAgent.h (161760 => 161761)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/inspector/InspectorDebuggerAgent.h        2014-01-11 14:17:12 UTC (rev 161760)
+++ trunk/Source/WebCore/inspector/InspectorDebuggerAgent.h        2014-01-11 15:51:31 UTC (rev 161761)
</span><span class="lines">@@ -74,7 +74,6 @@
</span><span class="cx">     virtual void willDestroyFrontendAndBackend() OVERRIDE;
</span><span class="cx"> 
</span><span class="cx">     bool isPaused();
</span><del>-    bool runningNestedMessageLoop();
</del><span class="cx">     void addMessageToConsole(MessageSource, MessageType);
</span><span class="cx"> 
</span><span class="cx">     // Part of the protocol.
</span></span></pre>
</div>
</div>

</body>
</html>