Title: [220342] trunk

Diff

Modified: trunk/LayoutTests/ChangeLog (220341 => 220342)


--- trunk/LayoutTests/ChangeLog	2017-08-07 16:42:41 UTC (rev 220341)
+++ trunk/LayoutTests/ChangeLog	2017-08-07 16:44:12 UTC (rev 220342)
@@ -1,3 +1,17 @@
+2017-08-07  Ryan Haddad  <ryanhad...@apple.com>
+
+        Unreviewed, rolling out r220299.
+
+        This change caused LayoutTest inspector/dom-debugger/dom-
+        breakpoints.html to fail.
+
+        Reverted changeset:
+
+        "Web Inspector: capture async stack trace when workers/main
+        context posts a message"
+        https://bugs.webkit.org/show_bug.cgi?id=167084
+        http://trac.webkit.org/changeset/220299
+
 2017-08-07  Ms2ger  <ms2...@igalia.com>
 
         Remove obsolete failure expectations for wpt browsers tests.

Modified: trunk/LayoutTests/inspector/debugger/async-stack-trace-expected.txt (220341 => 220342)


--- trunk/LayoutTests/inspector/debugger/async-stack-trace-expected.txt	2017-08-07 16:42:41 UTC (rev 220341)
+++ trunk/LayoutTests/inspector/debugger/async-stack-trace-expected.txt	2017-08-07 16:44:12 UTC (rev 220342)
@@ -1,9 +1,6 @@
-CONSOLE MESSAGE: line 55: Unable to post message to http://example.com. Recipient has origin .
-
 Tests for async stack traces.
 
 
-
 == Running test suite: AsyncStackTrace
 -- Running test case: CheckAsyncStackTrace.RequestAnimationFrame
 PAUSE #1
@@ -79,21 +76,6 @@
 4: --- addEventListener ---
 5: [F] testAddEventListener
 6: [P] Global Code
-
--- Running test case: CheckAsyncStackTrace.PostMessage
-PAUSE #1
-CALL STACK:
-0: [F] pauseThenFinishTest
-1: [F] postMessageFired
-ASYNC CALL STACK:
-2: --- postMessage ---
-3: [F] messageReceived
-4: --- postMessage ---
-5: [F] testPostMessage
-6: [P] Global Code
-
--- Running test case: ShouldNotPauseForFailedPostMessage
-PASS: Should not pause for failed post message.
 -- Running test setup.
 Save DebuggerManager.asyncStackTraceDepth
 

Modified: trunk/LayoutTests/inspector/debugger/async-stack-trace.html (220341 => 220342)


--- trunk/LayoutTests/inspector/debugger/async-stack-trace.html	2017-08-07 16:42:41 UTC (rev 220341)
+++ trunk/LayoutTests/inspector/debugger/async-stack-trace.html	2017-08-07 16:44:12 UTC (rev 220342)
@@ -50,23 +50,6 @@
     document.body.click();
 }
 
-function testPostMessage(targetOrigin = "*") {
-    let childFrame = document.getElementById("postMessageTestFrame");
-    childFrame.contentWindow.postMessage("<message>", targetOrigin);
-
-    window.addEventListener("message", function postMessageFired() {
-        window.removeEventListener("message", postMessageFired);
-        pauseThenFinishTest();
-    });
-}
-
-function testFailPostMessage() {
-    testPostMessage("http://example.com");
-    setTimeout(() => {
-        TestPage.dispatchEventToFrontend("AfterTestFunction");
-    }, 0);
-}
-
 function recursiveCallThenTest(testFunction, depth) {
     if (depth) {
         recursiveCallThenTest(testFunction, depth - 1);
@@ -96,17 +79,16 @@
             name: `CheckAsyncStackTrace.${name}`,
             test(resolve, reject) {
                 let pauseCount = 0;
-                function debuggerPaused() {
+                function handlePaused() {
                     InspectorTest.log(`PAUSE #${++pauseCount}`);
                     logActiveStackTrace();
                     WI.debuggerManager.resume();
                 }
 
-                WI.debuggerManager.addEventListener(WI.DebuggerManager.Event.Paused, debuggerPaused);
+                WI.debuggerManager.addEventListener(WI.DebuggerManager.Event.Paused, handlePaused);
 
-                InspectorTest.awaitEvent("AfterTestFunction")
-                .then(() => {
-                    WI.debuggerManager.removeEventListener(WI.DebuggerManager.Event.Paused, debuggerPaused);
+                InspectorTest.singleFireEventListener("AfterTestFunction", () => {
+                    WI.debuggerManager.removeEventListener(WI.DebuggerManager.Event.Paused, handlePaused);
                     resolve();
                 });
 
@@ -121,30 +103,7 @@
     addSimpleTestCase("ChainedRequestAnimationFrame", "testChainedRequestAnimationFrame()");
     addSimpleTestCase("ReferenceCounting", "testReferenceCounting()");
     addSimpleTestCase("AddEventListener", "testAddEventListener()");
-    addSimpleTestCase("PostMessage", "testPostMessage()");
 
-    suite.addTestCase({
-        name: "ShouldNotPauseForFailedPostMessage",
-        test(resolve, reject) {
-            function debuggerPaused() {
-                WI.debuggerManager.resume();
-                InspectorTest.fail("Should not pause.");
-                reject();
-            }
-
-            WI.debuggerManager.addEventListener(WI.DebuggerManager.Event.Paused, debuggerPaused);
-
-            InspectorTest.awaitEvent("AfterTestFunction")
-            .then(() => {
-                WI.debuggerManager.removeEventListener(WI.DebuggerManager.Event.Paused, debuggerPaused);
-                InspectorTest.pass("Should not pause for failed post message.");
-                resolve();
-            });
-
-            InspectorTest.evaluateInPage("testFailPostMessage()");
-        }
-    });
-
     function setup(resolve) {
         InspectorTest.log("Save DebuggerManager.asyncStackTraceDepth");
         this.savedCallStackDepth = WI.debuggerManager.asyncStackTraceDepth;
@@ -231,6 +190,5 @@
 </head>
 <body _onload_="runTest()">
 <p>Tests for async stack traces.</p>
-<iframe id="postMessageTestFrame" src=""
 </body>
 </html>

Deleted: trunk/LayoutTests/inspector/debugger/resources/postMessage-echo.html (220341 => 220342)


--- trunk/LayoutTests/inspector/debugger/resources/postMessage-echo.html	2017-08-07 16:42:41 UTC (rev 220341)
+++ trunk/LayoutTests/inspector/debugger/resources/postMessage-echo.html	2017-08-07 16:44:12 UTC (rev 220342)
@@ -1,6 +0,0 @@
-<script>
-window.addEventListener("message", function messageReceived(event) {
-    let echo = `iFrame postMessage echo: ${event.data}`;
-    parent.postMessage(echo, "*");
-});
-</script>

Modified: trunk/LayoutTests/inspector/dom-debugger/dom-breakpoints.html (220341 => 220342)


--- trunk/LayoutTests/inspector/dom-debugger/dom-breakpoints.html	2017-08-07 16:42:41 UTC (rev 220341)
+++ trunk/LayoutTests/inspector/dom-debugger/dom-breakpoints.html	2017-08-07 16:44:12 UTC (rev 220342)
@@ -36,6 +36,18 @@
         resolve();
     }
 
+    function awaitEvaluateInPage(_expression_) {
+        return new Promise((resolve, reject) => {
+            InspectorTest.log("Wait for evaluate in page to return.");
+            InspectorTest.evaluateInPage(_expression_, (error) => {
+                if (error)
+                    reject(error);
+
+                resolve();
+            });
+        });
+    }
+
     function rejectOnPause() {
         return new Promise((resolve, reject) => {
             WI.debuggerManager.awaitEvent(WI.DebuggerManager.Event.Paused)

Modified: trunk/Source/_javascript_Core/ChangeLog (220341 => 220342)


--- trunk/Source/_javascript_Core/ChangeLog	2017-08-07 16:42:41 UTC (rev 220341)
+++ trunk/Source/_javascript_Core/ChangeLog	2017-08-07 16:44:12 UTC (rev 220342)
@@ -1,3 +1,17 @@
+2017-08-07  Ryan Haddad  <ryanhad...@apple.com>
+
+        Unreviewed, rolling out r220299.
+
+        This change caused LayoutTest inspector/dom-debugger/dom-
+        breakpoints.html to fail.
+
+        Reverted changeset:
+
+        "Web Inspector: capture async stack trace when workers/main
+        context posts a message"
+        https://bugs.webkit.org/show_bug.cgi?id=167084
+        http://trac.webkit.org/changeset/220299
+
 2017-08-07  Brian Burg  <bb...@apple.com>
 
         Remove CANVAS_PATH compilation guard

Modified: trunk/Source/_javascript_Core/inspector/agents/InspectorDebuggerAgent.h (220341 => 220342)


--- trunk/Source/_javascript_Core/inspector/agents/InspectorDebuggerAgent.h	2017-08-07 16:42:41 UTC (rev 220341)
+++ trunk/Source/_javascript_Core/inspector/agents/InspectorDebuggerAgent.h	2017-08-07 16:44:12 UTC (rev 220342)
@@ -94,7 +94,6 @@
     enum class AsyncCallType {
         DOMTimer,
         EventListener,
-        PostMessage,
         RequestAnimationFrame,
     };
 

Modified: trunk/Source/WebCore/ChangeLog (220341 => 220342)


--- trunk/Source/WebCore/ChangeLog	2017-08-07 16:42:41 UTC (rev 220341)
+++ trunk/Source/WebCore/ChangeLog	2017-08-07 16:44:12 UTC (rev 220342)
@@ -1,3 +1,17 @@
+2017-08-07  Ryan Haddad  <ryanhad...@apple.com>
+
+        Unreviewed, rolling out r220299.
+
+        This change caused LayoutTest inspector/dom-debugger/dom-
+        breakpoints.html to fail.
+
+        Reverted changeset:
+
+        "Web Inspector: capture async stack trace when workers/main
+        context posts a message"
+        https://bugs.webkit.org/show_bug.cgi?id=167084
+        http://trac.webkit.org/changeset/220299
+
 2017-08-07  Brian Burg  <bb...@apple.com>
 
         Cleanup: simplify WebSockets code for RuntimeEnabledFeatures

Modified: trunk/Source/WebCore/inspector/InspectorInstrumentation.cpp (220341 => 220342)


--- trunk/Source/WebCore/inspector/InspectorInstrumentation.cpp	2017-08-07 16:42:41 UTC (rev 220341)
+++ trunk/Source/WebCore/inspector/InspectorInstrumentation.cpp	2017-08-07 16:44:12 UTC (rev 220342)
@@ -363,30 +363,6 @@
         pageDebuggerAgent->willRemoveEventListener(target, eventType, listener, capture);
 }
 
-void InspectorInstrumentation::didPostMessageImpl(InstrumentingAgents& instrumentingAgents, const TimerBase& timer, JSC::ExecState& state)
-{
-    if (PageDebuggerAgent* pageDebuggerAgent = instrumentingAgents.pageDebuggerAgent())
-        pageDebuggerAgent->didPostMessage(timer, state);
-}
-
-void InspectorInstrumentation::didFailPostMessageImpl(InstrumentingAgents& instrumentingAgents, const TimerBase& timer)
-{
-    if (PageDebuggerAgent* pageDebuggerAgent = instrumentingAgents.pageDebuggerAgent())
-        pageDebuggerAgent->didFailPostMessage(timer);
-}
-
-void InspectorInstrumentation::willDispatchPostMessageImpl(InstrumentingAgents& instrumentingAgents, const TimerBase& timer)
-{
-    if (PageDebuggerAgent* pageDebuggerAgent = instrumentingAgents.pageDebuggerAgent())
-        pageDebuggerAgent->willDispatchPostMessage(timer);
-}
-
-void InspectorInstrumentation::didDispatchPostMessageImpl(InstrumentingAgents& instrumentingAgents, const TimerBase& timer)
-{
-    if (PageDebuggerAgent* pageDebuggerAgent = instrumentingAgents.pageDebuggerAgent())
-        pageDebuggerAgent->didDispatchPostMessage(timer);
-}
-
 InspectorInstrumentationCookie InspectorInstrumentation::willCallFunctionImpl(InstrumentingAgents& instrumentingAgents, const String& scriptName, int scriptLine, ScriptExecutionContext* context)
 {
     int timelineAgentId = 0;

Modified: trunk/Source/WebCore/inspector/InspectorInstrumentation.h (220341 => 220342)


--- trunk/Source/WebCore/inspector/InspectorInstrumentation.h	2017-08-07 16:42:41 UTC (rev 220341)
+++ trunk/Source/WebCore/inspector/InspectorInstrumentation.h	2017-08-07 16:44:12 UTC (rev 220342)
@@ -85,7 +85,6 @@
 class ScriptExecutionContext;
 class SecurityOrigin;
 class ShadowRoot;
-class TimerBase;
 class URL;
 #if ENABLE(WEBGL)
 class WebGLProgram;
@@ -137,11 +136,6 @@
     static void didInstallTimer(ScriptExecutionContext&, int timerId, Seconds timeout, bool singleShot);
     static void didRemoveTimer(ScriptExecutionContext&, int timerId);
 
-    static void didPostMessage(Frame&, TimerBase&, JSC::ExecState&);
-    static void didFailPostMessage(Frame&, TimerBase&);
-    static void willDispatchPostMessage(Frame&, TimerBase&);
-    static void didDispatchPostMessage(Frame&, TimerBase&);
-
     static InspectorInstrumentationCookie willCallFunction(ScriptExecutionContext*, const String& scriptName, int scriptLine);
     static void didCallFunction(const InspectorInstrumentationCookie&, ScriptExecutionContext*);
     static void didAddEventListener(EventTarget&, const AtomicString& eventType);
@@ -308,11 +302,6 @@
     static void didInstallTimerImpl(InstrumentingAgents&, int timerId, Seconds timeout, bool singleShot, ScriptExecutionContext&);
     static void didRemoveTimerImpl(InstrumentingAgents&, int timerId, ScriptExecutionContext&);
 
-    static void didPostMessageImpl(InstrumentingAgents&, const TimerBase&, JSC::ExecState&);
-    static void didFailPostMessageImpl(InstrumentingAgents&, const TimerBase&);
-    static void willDispatchPostMessageImpl(InstrumentingAgents&, const TimerBase&);
-    static void didDispatchPostMessageImpl(InstrumentingAgents&, const TimerBase&);
-
     static InspectorInstrumentationCookie willCallFunctionImpl(InstrumentingAgents&, const String& scriptName, int scriptLine, ScriptExecutionContext*);
     static void didCallFunctionImpl(const InspectorInstrumentationCookie&, ScriptExecutionContext*);
     static void didAddEventListenerImpl(InstrumentingAgents&, EventTarget&, const AtomicString& eventType);
@@ -680,34 +669,6 @@
         willRemoveEventListenerImpl(*instrumentingAgents, target, eventType, listener, capture);
 }
 
-inline void InspectorInstrumentation::didPostMessage(Frame& frame, TimerBase& timer, JSC::ExecState& state)
-{
-    FAST_RETURN_IF_NO_FRONTENDS(void());
-    if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForFrame(frame))
-        didPostMessageImpl(*instrumentingAgents, timer, state);
-}
-
-inline void InspectorInstrumentation::didFailPostMessage(Frame& frame, TimerBase& timer)
-{
-    FAST_RETURN_IF_NO_FRONTENDS(void());
-    if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForFrame(frame))
-        didFailPostMessageImpl(*instrumentingAgents, timer);
-}
-
-inline void InspectorInstrumentation::willDispatchPostMessage(Frame& frame, TimerBase& timer)
-{
-    FAST_RETURN_IF_NO_FRONTENDS(void());
-    if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForFrame(frame))
-        willDispatchPostMessageImpl(*instrumentingAgents, timer);
-}
-
-inline void InspectorInstrumentation::didDispatchPostMessage(Frame& frame, TimerBase& timer)
-{
-    FAST_RETURN_IF_NO_FRONTENDS(void());
-    if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForFrame(frame))
-        didDispatchPostMessageImpl(*instrumentingAgents, timer);
-}
-
 inline InspectorInstrumentationCookie InspectorInstrumentation::willCallFunction(ScriptExecutionContext* context, const String& scriptName, int scriptLine)
 {
     FAST_RETURN_IF_NO_FRONTENDS(InspectorInstrumentationCookie());

Modified: trunk/Source/WebCore/inspector/PageDebuggerAgent.cpp (220341 => 220342)


--- trunk/Source/WebCore/inspector/PageDebuggerAgent.cpp	2017-08-07 16:42:41 UTC (rev 220341)
+++ trunk/Source/WebCore/inspector/PageDebuggerAgent.cpp	2017-08-07 16:44:12 UTC (rev 220342)
@@ -45,7 +45,6 @@
 #include "PageScriptDebugServer.h"
 #include "ScriptExecutionContext.h"
 #include "ScriptState.h"
-#include "Timer.h"
 #include <inspector/InjectedScript.h>
 #include <inspector/InjectedScriptManager.h>
 #include <inspector/ScriptCallStack.h>
@@ -100,9 +99,7 @@
 void PageDebuggerAgent::didClearAsyncStackTraceData()
 {
     m_registeredEventListeners.clear();
-    m_postMessageTimers.clear();
     m_nextEventListenerIdentifier = 1;
-    m_nextPostMessageIdentifier = 1;
 }
 
 void PageDebuggerAgent::muteConsole()
@@ -230,51 +227,4 @@
     didCancelAsyncCall(InspectorDebuggerAgent::AsyncCallType::RequestAnimationFrame, callbackId);
 }
 
-void PageDebuggerAgent::didPostMessage(const TimerBase& timer, JSC::ExecState& state)
-{
-    if (!breakpointsActive())
-        return;
-
-    if (m_postMessageTimers.contains(&timer)) {
-        ASSERT_NOT_REACHED();
-        return;
-    }
-
-    int postMessageIdentifier = m_nextPostMessageIdentifier++;
-    m_postMessageTimers.set(&timer, postMessageIdentifier);
-
-    didScheduleAsyncCall(&state, InspectorDebuggerAgent::AsyncCallType::PostMessage, postMessageIdentifier, true);
-}
-
-void PageDebuggerAgent::didFailPostMessage(const TimerBase& timer)
-{
-    auto it = m_postMessageTimers.find(&timer);
-    if (it == m_postMessageTimers.end())
-        return;
-
-    didCancelAsyncCall(InspectorDebuggerAgent::AsyncCallType::PostMessage, it->value);
-
-    m_postMessageTimers.remove(it);
-}
-
-void PageDebuggerAgent::willDispatchPostMessage(const TimerBase& timer)
-{
-    auto it = m_postMessageTimers.find(&timer);
-    if (it == m_postMessageTimers.end())
-        return;
-
-    willDispatchAsyncCall(InspectorDebuggerAgent::AsyncCallType::PostMessage, it->value);
-}
-
-void PageDebuggerAgent::didDispatchPostMessage(const TimerBase& timer)
-{
-    auto it = m_postMessageTimers.find(&timer);
-    if (it == m_postMessageTimers.end())
-        return;
-
-    didDispatchAsyncCall();
-
-    m_postMessageTimers.remove(it);
-}
-
 } // namespace WebCore

Modified: trunk/Source/WebCore/inspector/PageDebuggerAgent.h (220341 => 220342)


--- trunk/Source/WebCore/inspector/PageDebuggerAgent.h	2017-08-07 16:42:41 UTC (rev 220341)
+++ trunk/Source/WebCore/inspector/PageDebuggerAgent.h	2017-08-07 16:44:12 UTC (rev 220342)
@@ -42,7 +42,6 @@
 class InspectorPageAgent;
 class Page;
 class RegisteredEventListener;
-class TimerBase;
 
 class PageDebuggerAgent final : public WebDebuggerAgent {
     WTF_MAKE_NONCOPYABLE(PageDebuggerAgent);
@@ -65,11 +64,6 @@
     void willRemoveEventListener(EventTarget&, const AtomicString& eventType, EventListener&, bool capture);
     void willHandleEvent(const RegisteredEventListener&);
 
-    void didPostMessage(const TimerBase&, JSC::ExecState&);
-    void didFailPostMessage(const TimerBase&);
-    void willDispatchPostMessage(const TimerBase&);
-    void didDispatchPostMessage(const TimerBase&);
-
 protected:
     void enable() override;
     void disable(bool isBeingDestroyed) override;
@@ -93,9 +87,7 @@
     InspectorOverlay* m_overlay { nullptr };
 
     HashMap<const RegisteredEventListener*, int> m_registeredEventListeners;
-    HashMap<const TimerBase*, int> m_postMessageTimers;
     int m_nextEventListenerIdentifier { 1 };
-    int m_nextPostMessageIdentifier { 1 };
 };
 
 } // namespace WebCore

Modified: trunk/Source/WebCore/page/DOMWindow.cpp (220341 => 220342)


--- trunk/Source/WebCore/page/DOMWindow.cpp	2017-08-07 16:42:41 UTC (rev 220341)
+++ trunk/Source/WebCore/page/DOMWindow.cpp	2017-08-07 16:44:12 UTC (rev 220342)
@@ -956,8 +956,6 @@
     auto* timer = new PostMessageTimer(*this, message.releaseReturnValue(), sourceOrigin, incumbentWindow, channels.releaseReturnValue(), WTFMove(target), WTFMove(stackTrace));
     timer->startOneShot(0_s);
 
-    InspectorInstrumentation::didPostMessage(*m_frame, *timer, state);
-
     return { };
 }
 
@@ -976,17 +974,11 @@
                 else
                     pageConsole->addMessage(MessageSource::Security, MessageLevel::Error, message);
             }
-
-            InspectorInstrumentation::didFailPostMessage(*m_frame, timer);
             return;
         }
     }
 
-    InspectorInstrumentation::willDispatchPostMessage(*m_frame, timer);
-
     dispatchEvent(timer.event(*document()));
-
-    InspectorInstrumentation::didDispatchPostMessage(*m_frame, timer);
 }
 
 DOMSelection* DOMWindow::getSelection()
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to