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

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

Issue 1878463002: Move DOMArrayBuffer, DOMArrayBufferViews and DataView to the heap. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: tidy Created 4 years, 8 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 e0101c9769e82c8047a95be27f8f2ad0e9bba938..b24931ac44f75fcc4abd5de9be6f6d1c4d7e98f1 100644
--- a/third_party/WebKit/Source/modules/mediastream/RTCDataChannel.cpp
+++ b/third_party/WebKit/Source/modules/mediastream/RTCDataChannel.cpp
@@ -195,15 +195,13 @@ void RTCDataChannel::send(const String& data, ExceptionState& exceptionState)
}
}
-void RTCDataChannel::send(PassRefPtr<DOMArrayBuffer> prpData, ExceptionState& exceptionState)
+void RTCDataChannel::send(DOMArrayBuffer* data, ExceptionState& exceptionState)
{
if (m_readyState != ReadyStateOpen) {
throwNotOpenException(exceptionState);
return;
}
- RefPtr<DOMArrayBuffer> data = prpData;
-
size_t dataLength = data->byteLength();
if (!dataLength)
return;
@@ -214,7 +212,7 @@ void RTCDataChannel::send(PassRefPtr<DOMArrayBuffer> prpData, ExceptionState& ex
}
}
-void RTCDataChannel::send(PassRefPtr<DOMArrayBufferView> data, ExceptionState& exceptionState)
+void RTCDataChannel::send(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.
@@ -272,8 +270,8 @@ void RTCDataChannel::didReceiveRawData(const char* data, size_t dataLength)
return;
}
if (m_binaryType == BinaryTypeArrayBuffer) {
- RefPtr<DOMArrayBuffer> buffer = DOMArrayBuffer::create(data, dataLength);
- scheduleDispatchEvent(MessageEvent::create(buffer.release()));
+ DOMArrayBuffer* buffer = DOMArrayBuffer::create(data, dataLength);
+ scheduleDispatchEvent(MessageEvent::create(buffer));
return;
}
NOTREACHED();

Powered by Google App Engine
This is Rietveld 408576698