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

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

Issue 334873002: [WebSocket] Make subprotocol and extensions live in WebSocket (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 6 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: Source/modules/websockets/MainThreadWebSocketChannel.cpp
diff --git a/Source/modules/websockets/MainThreadWebSocketChannel.cpp b/Source/modules/websockets/MainThreadWebSocketChannel.cpp
index 5867f28ba226e620b9617d5cedd043983be501d2..67bdb44290e30bc736413c619d5b98aafe1b46e3 100644
--- a/Source/modules/websockets/MainThreadWebSocketChannel.cpp
+++ b/Source/modules/websockets/MainThreadWebSocketChannel.cpp
@@ -124,28 +124,6 @@ bool MainThreadWebSocketChannel::connect(const KURL& url, const String& protocol
return true;
}
-String MainThreadWebSocketChannel::subprotocol()
-{
- WTF_LOG(Network, "MainThreadWebSocketChannel %p subprotocol()", this);
- if (!m_handshake || m_handshake->mode() != WebSocketHandshake::Connected)
- return "";
- String serverProtocol = m_handshake->serverWebSocketProtocol();
- if (serverProtocol.isNull())
- return "";
- return serverProtocol;
-}
-
-String MainThreadWebSocketChannel::extensions()
-{
- WTF_LOG(Network, "MainThreadWebSocketChannel %p extensions()", this);
- if (!m_handshake || m_handshake->mode() != WebSocketHandshake::Connected)
- return "";
- String extensions = m_handshake->acceptedExtensions();
- if (extensions.isNull())
- return "";
- return extensions;
-}
-
WebSocketChannel::SendResult MainThreadWebSocketChannel::send(const String& message)
{
WTF_LOG(Network, "MainThreadWebSocketChannel %p send() Sending String '%s'", this, message.utf8().data());
@@ -484,7 +462,9 @@ bool MainThreadWebSocketChannel::processOneItemFromBuffer()
WTF_LOG(Network, "MainThreadWebSocketChannel %p Connected", this);
skipBuffer(headerLength);
- m_client->didConnect();
+ String subprotocol = m_handshake->serverWebSocketProtocol();
+ String extensions = m_handshake->acceptedExtensions();
+ m_client->didConnect(subprotocol.isNull() ? "" : subprotocol, extensions.isNull() ? "" : extensions);
WTF_LOG(Network, "MainThreadWebSocketChannel %p %lu bytes remaining in m_buffer", this, static_cast<unsigned long>(m_buffer.size()));
return !m_buffer.isEmpty();
}
« no previous file with comments | « Source/modules/websockets/MainThreadWebSocketChannel.h ('k') | Source/modules/websockets/NewWebSocketChannelImpl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698