Index: third_party/WebKit/Source/modules/mediastream/RTCDataChannel.cpp |
diff --git a/third_party/WebKit/Source/modules/mediastream/RTCDataChannel.cpp b/third_party/WebKit/Source/modules/mediastream/RTCDataChannel.cpp |
index b24931ac44f75fcc4abd5de9be6f6d1c4d7e98f1..e0101c9769e82c8047a95be27f8f2ad0e9bba938 100644 |
--- a/third_party/WebKit/Source/modules/mediastream/RTCDataChannel.cpp |
+++ b/third_party/WebKit/Source/modules/mediastream/RTCDataChannel.cpp |
@@ -195,12 +195,14 @@ |
} |
} |
-void RTCDataChannel::send(DOMArrayBuffer* data, ExceptionState& exceptionState) |
+void RTCDataChannel::send(PassRefPtr<DOMArrayBuffer> prpData, ExceptionState& exceptionState) |
{ |
if (m_readyState != ReadyStateOpen) { |
throwNotOpenException(exceptionState); |
return; |
} |
+ |
+ RefPtr<DOMArrayBuffer> data = prpData; |
size_t dataLength = data->byteLength(); |
if (!dataLength) |
@@ -212,7 +214,7 @@ |
} |
} |
-void RTCDataChannel::send(DOMArrayBufferView* data, ExceptionState& exceptionState) |
+void RTCDataChannel::send(PassRefPtr<DOMArrayBufferView> data, ExceptionState& exceptionState) |
{ |
if (!m_handler->sendRawData(static_cast<const char*>(data->baseAddress()), data->byteLength())) { |
// FIXME: This should not throw an exception but instead forcefully close the data channel. |
@@ -270,8 +272,8 @@ |
return; |
} |
if (m_binaryType == BinaryTypeArrayBuffer) { |
- DOMArrayBuffer* buffer = DOMArrayBuffer::create(data, dataLength); |
- scheduleDispatchEvent(MessageEvent::create(buffer)); |
+ RefPtr<DOMArrayBuffer> buffer = DOMArrayBuffer::create(data, dataLength); |
+ scheduleDispatchEvent(MessageEvent::create(buffer.release())); |
return; |
} |
NOTREACHED(); |