Index: Source/modules/mediastream/RTCDataChannel.cpp |
diff --git a/Source/modules/mediastream/RTCDataChannel.cpp b/Source/modules/mediastream/RTCDataChannel.cpp |
index ddd6416f00cdf3b1762651c3b40e0232ea95b5c5..5115fabee570af20dfd358413ecad1e9d214c286 100644 |
--- a/Source/modules/mediastream/RTCDataChannel.cpp |
+++ b/Source/modules/mediastream/RTCDataChannel.cpp |
@@ -37,6 +37,8 @@ |
namespace WebCore { |
+DEFINE_GC_INFO(RTCDataChannel); |
+ |
static void throwNotOpenException(ExceptionState& exceptionState) |
{ |
exceptionState.throwDOMException(InvalidStateError, "RTCDataChannel.readyState is not 'open'"); |
@@ -52,20 +54,20 @@ static void throwNoBlobSupportException(ExceptionState& exceptionState) |
exceptionState.throwDOMException(NotSupportedError, "Blob support not implemented yet"); |
} |
-PassRefPtr<RTCDataChannel> RTCDataChannel::create(ExecutionContext* context, PassOwnPtr<blink::WebRTCDataChannelHandler> handler) |
+PassRefPtrWillBeRawPtr<RTCDataChannel> RTCDataChannel::create(ExecutionContext* context, PassOwnPtr<blink::WebRTCDataChannelHandler> handler) |
{ |
ASSERT(handler); |
- return adoptRef(new RTCDataChannel(context, handler)); |
+ return adoptRefCountedWillBeRefCountedGarbageCollected(new RTCDataChannel(context, handler)); |
} |
-PassRefPtr<RTCDataChannel> RTCDataChannel::create(ExecutionContext* context, blink::WebRTCPeerConnectionHandler* peerConnectionHandler, const String& label, const blink::WebRTCDataChannelInit& init, ExceptionState& exceptionState) |
+PassRefPtrWillBeRawPtr<RTCDataChannel> RTCDataChannel::create(ExecutionContext* context, blink::WebRTCPeerConnectionHandler* peerConnectionHandler, const String& label, const blink::WebRTCDataChannelInit& init, ExceptionState& exceptionState) |
{ |
OwnPtr<blink::WebRTCDataChannelHandler> handler = adoptPtr(peerConnectionHandler->createDataChannel(label, init)); |
if (!handler) { |
exceptionState.throwDOMException(NotSupportedError, "RTCDataChannel is not supported"); |
return nullptr; |
} |
- return adoptRef(new RTCDataChannel(context, handler.release())); |
+ return adoptRefCountedWillBeRefCountedGarbageCollected(new RTCDataChannel(context, handler.release())); |
} |
RTCDataChannel::RTCDataChannel(ExecutionContext* context, PassOwnPtr<blink::WebRTCDataChannelHandler> handler) |