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

Unified Diff: Source/modules/websockets/DOMWebSocket.cpp

Issue 337343002: IDL: make optional arguments (without default) explicit sometimes Base URL: https://chromium.googlesource.com/chromium/blink.git@idl-default-arguments-next
Patch Set: Created 6 years, 4 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/websockets/DOMWebSocket.h ('k') | Source/modules/websockets/DOMWebSocketTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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)
« no previous file with comments | « Source/modules/websockets/DOMWebSocket.h ('k') | Source/modules/websockets/DOMWebSocketTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698