diff options
author | ricea@chromium.org <ricea@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-01-29 00:42:45 +0000 |
---|---|---|
committer | ricea@chromium.org <ricea@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-01-29 00:42:45 +0000 |
commit | 0be9392b7cc037c74baa929bc384baf36b0001f3 (patch) | |
tree | 1d6886902c5cfb1e1db8017483ca703a54bffc06 /net/websockets/websocket_handshake_stream_create_helper.cc | |
parent | 73b6ae22b6e1a9ebd6a83de0527267f40d6f22b3 (diff) | |
download | chromium_src-0be9392b7cc037c74baa929bc384baf36b0001f3.zip chromium_src-0be9392b7cc037c74baa929bc384baf36b0001f3.tar.gz chromium_src-0be9392b7cc037c74baa929bc384baf36b0001f3.tar.bz2 |
Advertise the permessage-deflate extension and enable it when requested by the server.
Also validation and parsing of the permessage-deflate extension parameters, and unit tests.
BUG=280910
TEST=net_unittests --gtest_filter=WebSocket*
Review URL: https://codereview.chromium.org/143913003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@247545 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/websockets/websocket_handshake_stream_create_helper.cc')
-rw-r--r-- | net/websockets/websocket_handshake_stream_create_helper.cc | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/net/websockets/websocket_handshake_stream_create_helper.cc b/net/websockets/websocket_handshake_stream_create_helper.cc index 8268cda..b3ff3e2 100644 --- a/net/websockets/websocket_handshake_stream_create_helper.cc +++ b/net/websockets/websocket_handshake_stream_create_helper.cc @@ -26,12 +26,17 @@ WebSocketHandshakeStreamBase* WebSocketHandshakeStreamCreateHelper::CreateBasicStream( scoped_ptr<ClientSocketHandle> connection, bool using_proxy) { + // The list of supported extensions and parameters is hard-coded. + // TODO(ricea): If more extensions are added, consider a more flexible + // method. + std::vector<std::string> extensions( + 1, "permessage-deflate; client_max_window_bits"); return stream_ = new WebSocketBasicHandshakeStream(connection.Pass(), connect_delegate_, using_proxy, requested_subprotocols_, - std::vector<std::string>()); + extensions); } // TODO(ricea): Create a WebSocketSpdyHandshakeStream. crbug.com/323852 |