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

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

Issue 606653006: bindings: Adds DOMArrayBuffer, etc. as thin wrappers for ArrayBuffer, etc. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Synced. Created 6 years, 2 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
« no previous file with comments | « Source/modules/mediastream/RTCDataChannel.h ('k') | Source/modules/serviceworkers/Body.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/modules/mediastream/RTCDataChannel.cpp
diff --git a/Source/modules/mediastream/RTCDataChannel.cpp b/Source/modules/mediastream/RTCDataChannel.cpp
index 77a38d88b7b428987ea0f26dce320a086b9a11e5..8a5c4f322fb95070ab71f0b97cae7a3235d694b8 100644
--- a/Source/modules/mediastream/RTCDataChannel.cpp
+++ b/Source/modules/mediastream/RTCDataChannel.cpp
@@ -26,14 +26,14 @@
#include "modules/mediastream/RTCDataChannel.h"
#include "bindings/core/v8/ExceptionState.h"
+#include "core/dom/DOMArrayBuffer.h"
+#include "core/dom/DOMArrayBufferView.h"
#include "core/dom/ExceptionCode.h"
#include "core/dom/ExecutionContext.h"
#include "core/events/MessageEvent.h"
#include "core/fileapi/Blob.h"
#include "modules/mediastream/RTCPeerConnection.h"
#include "public/platform/WebRTCPeerConnectionHandler.h"
-#include "wtf/ArrayBuffer.h"
-#include "wtf/ArrayBufferView.h"
namespace blink {
@@ -185,14 +185,14 @@ void RTCDataChannel::send(const String& data, ExceptionState& exceptionState)
}
}
-void RTCDataChannel::send(PassRefPtr<ArrayBuffer> prpData, ExceptionState& exceptionState)
+void RTCDataChannel::send(PassRefPtr<DOMArrayBuffer> prpData, ExceptionState& exceptionState)
{
if (m_readyState != ReadyStateOpen) {
throwNotOpenException(exceptionState);
return;
}
- RefPtr<ArrayBuffer> data = prpData;
+ RefPtr<DOMArrayBuffer> data = prpData;
size_t dataLength = data->byteLength();
if (!dataLength)
@@ -204,7 +204,7 @@ void RTCDataChannel::send(PassRefPtr<ArrayBuffer> prpData, ExceptionState& excep
}
}
-void RTCDataChannel::send(PassRefPtr<ArrayBufferView> 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.
@@ -263,7 +263,7 @@ void RTCDataChannel::didReceiveRawData(const char* data, size_t dataLength)
return;
}
if (m_binaryType == BinaryTypeArrayBuffer) {
- RefPtr<ArrayBuffer> buffer = ArrayBuffer::create(data, dataLength);
+ RefPtr<DOMArrayBuffer> buffer = DOMArrayBuffer::create(data, dataLength);
scheduleDispatchEvent(MessageEvent::create(buffer.release()));
return;
}
« no previous file with comments | « Source/modules/mediastream/RTCDataChannel.h ('k') | Source/modules/serviceworkers/Body.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698