Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1214)

Unified Diff: third_party/WebKit/Source/modules/mediastream/RTCDataChannel.cpp

Issue 1964183004: Revert of Move DOMArrayBuffer, DOMArrayBufferViews and DataView to the heap. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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();

Powered by Google App Engine
This is Rietveld 408576698