Title: [214500] trunk
Revision
214500
Author
[email protected]
Date
2017-03-28 15:32:43 -0700 (Tue, 28 Mar 2017)

Log Message

Unreviewed, rolling out r214485.

This change caused LayoutTest crashes.

Reverted changeset:

"Stop RTCDataChannel when closing page"
https://bugs.webkit.org/show_bug.cgi?id=170166
http://trac.webkit.org/changeset/214485

Modified Paths

Removed Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (214499 => 214500)


--- trunk/LayoutTests/ChangeLog	2017-03-28 22:26:25 UTC (rev 214499)
+++ trunk/LayoutTests/ChangeLog	2017-03-28 22:32:43 UTC (rev 214500)
@@ -1,3 +1,15 @@
+2017-03-28  Ryan Haddad  <[email protected]>
+
+        Unreviewed, rolling out r214485.
+
+        This change caused LayoutTest crashes.
+
+        Reverted changeset:
+
+        "Stop RTCDataChannel when closing page"
+        https://bugs.webkit.org/show_bug.cgi?id=170166
+        http://trac.webkit.org/changeset/214485
+
 2017-03-28  Brian Burg  <[email protected]>
 
         Web Inspector: Add "Disable Caches" option that only applies to the inspected page while Web Inspector is open

Deleted: trunk/LayoutTests/webrtc/datachannel/datachannel-gc-expected.txt (214499 => 214500)


--- trunk/LayoutTests/webrtc/datachannel/datachannel-gc-expected.txt	2017-03-28 22:26:25 UTC (rev 214499)
+++ trunk/LayoutTests/webrtc/datachannel/datachannel-gc-expected.txt	2017-03-28 22:32:43 UTC (rev 214500)
@@ -1,3 +0,0 @@
-
-PASS Losing local channel reference and closing it on the other side should still allow emitting the close event 
-

Deleted: trunk/LayoutTests/webrtc/datachannel/datachannel-gc.html (214499 => 214500)


--- trunk/LayoutTests/webrtc/datachannel/datachannel-gc.html	2017-03-28 22:26:25 UTC (rev 214499)
+++ trunk/LayoutTests/webrtc/datachannel/datachannel-gc.html	2017-03-28 22:32:43 UTC (rev 214500)
@@ -1,35 +0,0 @@
-<!doctype html>
-<html>
-  <head>
-    <meta charset="utf-8">
-    <title>Testing basic data channel and garbage collection</title>
-    <script src=""
-    <script src=""
-  </head>
-  <body>
-    <script src =""
-    <script>
-var finishTest;
-promise_test((test) => {
-    counter = 0;
-    return new Promise((resolve, reject) => {
-        if (window.internals)
-            internals.useMockRTCPeerConnectionFactory("TwoRealPeerConnections");
-
-        createConnections((localConnection) => {
-            localConnection.createDataChannel('sendDataChannel')._onclose_ = resolve;
-        }, (remoteConnection) => {
-            remoteConnection._ondatachannel_ = (event) => {
-                var remoteChannel = event.channel;
-                remoteChannel.close();
-            };
-        });
-        if (window.GCController)
-            return GCController.collect();
-    }).then(() => {
-        closeConnections();
-    });
-}, "Losing local channel reference and closing it on the other side should still allow emitting the close event");
-    </script>
-  </body>
-</html>

Modified: trunk/Source/WebCore/ChangeLog (214499 => 214500)


--- trunk/Source/WebCore/ChangeLog	2017-03-28 22:26:25 UTC (rev 214499)
+++ trunk/Source/WebCore/ChangeLog	2017-03-28 22:32:43 UTC (rev 214500)
@@ -1,3 +1,15 @@
+2017-03-28  Ryan Haddad  <[email protected]>
+
+        Unreviewed, rolling out r214485.
+
+        This change caused LayoutTest crashes.
+
+        Reverted changeset:
+
+        "Stop RTCDataChannel when closing page"
+        https://bugs.webkit.org/show_bug.cgi?id=170166
+        http://trac.webkit.org/changeset/214485
+
 2017-03-28  Anders Carlsson  <[email protected]>
 
         ApplePayShippingContactUpdate.idl shouldn't have status field

Modified: trunk/Source/WebCore/Modules/mediastream/RTCDataChannel.cpp (214499 => 214500)


--- trunk/Source/WebCore/Modules/mediastream/RTCDataChannel.cpp	2017-03-28 22:26:25 UTC (rev 214499)
+++ trunk/Source/WebCore/Modules/mediastream/RTCDataChannel.cpp	2017-03-28 22:32:43 UTC (rev 214500)
@@ -56,13 +56,12 @@
 {
     ASSERT(handler);
     auto channel = adoptRef(*new RTCDataChannel(context, WTFMove(handler), WTFMove(label), WTFMove(options)));
-    channel->m_handler->setClient(channel.ptr());
-    channel->setPendingActivity(channel.ptr());
+    channel->m_handler->setClient(&channel.get());
     return channel;
 }
 
 RTCDataChannel::RTCDataChannel(ScriptExecutionContext& context, std::unique_ptr<RTCDataChannelHandler>&& handler, String&& label, RTCDataChannelInit&& options)
-    : ActiveDOMObject(&context)
+    : m_scriptExecutionContext(&context)
     , m_handler(WTFMove(handler))
     , m_scheduledEventTimer(*this, &RTCDataChannel::scheduledEventTimerFired)
     , m_label(WTFMove(label))
@@ -169,13 +168,7 @@
     if (m_stopped)
         return;
 
-    m_stopped = true;
-    m_readyState = ReadyStateClosed;
-
     m_handler->close();
-    m_handler->setClient(nullptr);
-    m_handler = nullptr;
-    unsetPendingActivity(this);
 }
 
 void RTCDataChannel::didChangeReadyState(ReadyState newState)
@@ -241,7 +234,10 @@
 
 void RTCDataChannel::stop()
 {
-    close();
+    m_stopped = true;
+    m_readyState = ReadyStateClosed;
+    m_handler->setClient(nullptr);
+    m_scriptExecutionContext = nullptr;
 }
 
 void RTCDataChannel::scheduleDispatchEvent(Ref<Event>&& event)

Modified: trunk/Source/WebCore/Modules/mediastream/RTCDataChannel.h (214499 => 214500)


--- trunk/Source/WebCore/Modules/mediastream/RTCDataChannel.h	2017-03-28 22:26:25 UTC (rev 214499)
+++ trunk/Source/WebCore/Modules/mediastream/RTCDataChannel.h	2017-03-28 22:32:43 UTC (rev 214500)
@@ -26,7 +26,6 @@
 
 #if ENABLE(WEB_RTC)
 
-#include "ActiveDOMObject.h"
 #include "Event.h"
 #include "EventTarget.h"
 #include "ExceptionOr.h"
@@ -45,7 +44,7 @@
 class Blob;
 class RTCPeerConnectionHandler;
 
-class RTCDataChannel final : public ActiveDOMObject, public RTCDataChannelHandlerClient, public EventTargetWithInlineData {
+class RTCDataChannel final : public RTCDataChannelHandlerClient, public EventTargetWithInlineData {
 public:
     static Ref<RTCDataChannel> create(ScriptExecutionContext&, std::unique_ptr<RTCDataChannelHandler>&&, String&&, RTCDataChannelInit&&);
 
@@ -72,6 +71,8 @@
 
     void close();
 
+    void stop();
+
     using RTCDataChannelHandlerClient::ref;
     using RTCDataChannelHandlerClient::deref;
 
@@ -87,10 +88,7 @@
     void refEventTarget() final { ref(); }
     void derefEventTarget() final { deref(); }
 
-    // ActiveDOMObject API
-    void stop() final;
-    const char* activeDOMObjectName() const final { return "RTCDataChannel"; }
-    bool canSuspendForDocumentSuspension() const final { return m_readyState == ReadyStateClosed; }
+    ScriptExecutionContext* m_scriptExecutionContext;
 
     // RTCDataChannelHandlerClient API
     void didChangeReadyState(ReadyState) final;

Modified: trunk/Source/WebCore/Modules/mediastream/RTCDataChannel.idl (214499 => 214500)


--- trunk/Source/WebCore/Modules/mediastream/RTCDataChannel.idl	2017-03-28 22:26:25 UTC (rev 214499)
+++ trunk/Source/WebCore/Modules/mediastream/RTCDataChannel.idl	2017-03-28 22:32:43 UTC (rev 214500)
@@ -23,7 +23,6 @@
  */
 
 [
-    ActiveDOMObject,
     Conditional=WEB_RTC,
     NoInterfaceObject,
 ] interface RTCDataChannel : EventTarget {

Modified: trunk/Source/WebCore/Modules/mediastream/RTCPeerConnection.h (214499 => 214500)


--- trunk/Source/WebCore/Modules/mediastream/RTCPeerConnection.h	2017-03-28 22:26:25 UTC (rev 214499)
+++ trunk/Source/WebCore/Modules/mediastream/RTCPeerConnection.h	2017-03-28 22:32:43 UTC (rev 214500)
@@ -178,6 +178,8 @@
 
     std::unique_ptr<RtpTransceiverSet> m_transceiverSet { std::unique_ptr<RtpTransceiverSet>(new RtpTransceiverSet()) };
 
+    Vector<RefPtr<RTCDataChannel>> m_dataChannels;
+
     std::unique_ptr<PeerConnectionBackend> m_backend;
 
     RTCConfiguration m_configuration;
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to