Index: Source/modules/websockets/DOMWebSocket.cpp |
diff --git a/Source/modules/websockets/DOMWebSocket.cpp b/Source/modules/websockets/DOMWebSocket.cpp |
index 43d4d31973ee2af896a26305b4509d8907175069..8ffd515fd1c4c383465c77b67cd0546a8bf04c24 100644 |
--- a/Source/modules/websockets/DOMWebSocket.cpp |
+++ b/Source/modules/websockets/DOMWebSocket.cpp |
@@ -248,12 +248,6 @@ void DOMWebSocket::logError(const String& message) |
executionContext()->addConsoleMessage(ConsoleMessage::create(JSMessageSource, ErrorMessageLevel, message)); |
} |
-DOMWebSocket* DOMWebSocket::create(ExecutionContext* context, const String& url, ExceptionState& exceptionState) |
-{ |
- Vector<String> protocols; |
- return create(context, url, protocols, exceptionState); |
-} |
- |
DOMWebSocket* DOMWebSocket::create(ExecutionContext* context, const String& url, const Vector<String>& protocols, ExceptionState& exceptionState) |
{ |
if (url.isNull()) { |
@@ -274,7 +268,8 @@ DOMWebSocket* DOMWebSocket::create(ExecutionContext* context, const String& url, |
DOMWebSocket* DOMWebSocket::create(ExecutionContext* context, const String& url, const String& protocol, ExceptionState& exceptionState) |
{ |
Vector<String> protocols; |
- protocols.append(protocol); |
+ if (!protocol.isNull()) |
+ protocols.append(protocol); |
return create(context, url, protocols, exceptionState); |
} |
@@ -447,19 +442,9 @@ void DOMWebSocket::send(Blob* binaryData, ExceptionState& exceptionState) |
m_channel->send(binaryData->blobDataHandle()); |
} |
-void DOMWebSocket::close(unsigned short code, const String& reason, ExceptionState& exceptionState) |
-{ |
- closeInternal(code, reason, exceptionState); |
-} |
- |
-void DOMWebSocket::close(ExceptionState& exceptionState) |
-{ |
- closeInternal(WebSocketChannel::CloseEventCodeNotSpecified, String(), exceptionState); |
-} |
- |
-void DOMWebSocket::close(unsigned short code, ExceptionState& exceptionState) |
+void DOMWebSocket::close(Optional<unsigned short> optionalCode, const String& reason, ExceptionState& exceptionState) |
{ |
- closeInternal(code, String(), exceptionState); |
+ closeInternal(optionalCode.isMissing() ? WebSocketChannel::CloseEventCodeNotSpecified : optionalCode.get(), reason, exceptionState); |
} |
void DOMWebSocket::closeInternal(int code, const String& reason, ExceptionState& exceptionState) |