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

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

Issue 19724003: Revert "Transition modules/** to use ExceptionState" (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 5 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/mediastream/RTCIceCandidate.h » ('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 9f3c7b94df46da8d90853ace37609215dac9bdb0..7192688c3de343ef5805b4171f4a6786ab64826a 100644
--- a/Source/modules/mediastream/RTCDataChannel.cpp
+++ b/Source/modules/mediastream/RTCDataChannel.cpp
@@ -23,9 +23,9 @@
*/
#include "config.h"
+
#include "modules/mediastream/RTCDataChannel.h"
-#include "bindings/v8/ExceptionState.h"
#include "core/dom/Event.h"
#include "core/dom/ExceptionCode.h"
#include "core/dom/MessageEvent.h"
@@ -44,11 +44,11 @@ PassRefPtr<RTCDataChannel> RTCDataChannel::create(ScriptExecutionContext* contex
return adoptRef(new RTCDataChannel(context, handler));
}
-PassRefPtr<RTCDataChannel> RTCDataChannel::create(ScriptExecutionContext* context, RTCPeerConnectionHandler* peerConnectionHandler, const String& label, const WebKit::WebRTCDataChannelInit& init, ExceptionState& es)
+PassRefPtr<RTCDataChannel> RTCDataChannel::create(ScriptExecutionContext* context, RTCPeerConnectionHandler* peerConnectionHandler, const String& label, const WebKit::WebRTCDataChannelInit& init, ExceptionCode& ec)
{
OwnPtr<RTCDataChannelHandler> handler = peerConnectionHandler->createDataChannel(label, init);
if (!handler) {
- es.throwDOMException(NotSupportedError);
+ ec = NotSupportedError;
return 0;
}
return adoptRef(new RTCDataChannel(context, handler.release()));
@@ -114,32 +114,32 @@ String RTCDataChannel::binaryType() const
return String();
}
-void RTCDataChannel::setBinaryType(const String& binaryType, ExceptionState& es)
+void RTCDataChannel::setBinaryType(const String& binaryType, ExceptionCode& ec)
{
if (binaryType == "blob")
- es.throwDOMException(NotSupportedError);
+ ec = NotSupportedError;
else if (binaryType == "arraybuffer")
m_binaryType = BinaryTypeArrayBuffer;
else
- es.throwDOMException(TypeMismatchError);
+ ec = TypeMismatchError;
}
-void RTCDataChannel::send(const String& data, ExceptionState& es)
+void RTCDataChannel::send(const String& data, ExceptionCode& ec)
{
if (m_readyState != ReadyStateOpen) {
- es.throwDOMException(InvalidStateError);
+ ec = InvalidStateError;
return;
}
if (!m_handler->sendStringData(data)) {
// FIXME: Decide what the right exception here is.
- es.throwDOMException(SyntaxError);
+ ec = SyntaxError;
}
}
-void RTCDataChannel::send(PassRefPtr<ArrayBuffer> prpData, ExceptionState& es)
+void RTCDataChannel::send(PassRefPtr<ArrayBuffer> prpData, ExceptionCode& ec)
{
if (m_readyState != ReadyStateOpen) {
- es.throwDOMException(InvalidStateError);
+ ec = InvalidStateError;
return;
}
@@ -153,20 +153,20 @@ void RTCDataChannel::send(PassRefPtr<ArrayBuffer> prpData, ExceptionState& es)
if (!m_handler->sendRawData(dataPointer, dataLength)) {
// FIXME: Decide what the right exception here is.
- es.throwDOMException(SyntaxError);
+ ec = SyntaxError;
}
}
-void RTCDataChannel::send(PassRefPtr<ArrayBufferView> data, ExceptionState& es)
+void RTCDataChannel::send(PassRefPtr<ArrayBufferView> data, ExceptionCode& ec)
{
RefPtr<ArrayBuffer> arrayBuffer(data->buffer());
- send(arrayBuffer.release(), es);
+ send(arrayBuffer.release(), ec);
}
-void RTCDataChannel::send(PassRefPtr<Blob> data, ExceptionState& es)
+void RTCDataChannel::send(PassRefPtr<Blob> data, ExceptionCode& ec)
{
// FIXME: implement
- es.throwDOMException(NotSupportedError);
+ ec = NotSupportedError;
}
void RTCDataChannel::close()
« no previous file with comments | « Source/modules/mediastream/RTCDataChannel.h ('k') | Source/modules/mediastream/RTCIceCandidate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698