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

Side by Side Diff: net/websockets/websocket_handshake_stream_create_helper.cc

Issue 143913003: Add construction of WebSocketDeflateStream (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Rebase and add DCHECK() for extension params. Created 6 years, 10 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 unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "net/websockets/websocket_handshake_stream_create_helper.h" 5 #include "net/websockets/websocket_handshake_stream_create_helper.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/memory/scoped_ptr.h" 8 #include "base/memory/scoped_ptr.h"
9 #include "base/memory/weak_ptr.h" 9 #include "base/memory/weak_ptr.h"
10 #include "net/socket/client_socket_handle.h" 10 #include "net/socket/client_socket_handle.h"
11 #include "net/spdy/spdy_session.h" 11 #include "net/spdy/spdy_session.h"
12 #include "net/websockets/websocket_basic_handshake_stream.h" 12 #include "net/websockets/websocket_basic_handshake_stream.h"
13 13
14 namespace net { 14 namespace net {
15 15
16 WebSocketHandshakeStreamCreateHelper::WebSocketHandshakeStreamCreateHelper( 16 WebSocketHandshakeStreamCreateHelper::WebSocketHandshakeStreamCreateHelper(
17 WebSocketStream::ConnectDelegate* connect_delegate, 17 WebSocketStream::ConnectDelegate* connect_delegate,
18 const std::vector<std::string>& requested_subprotocols) 18 const std::vector<std::string>& requested_subprotocols)
19 : requested_subprotocols_(requested_subprotocols), 19 : requested_subprotocols_(requested_subprotocols),
20 stream_(NULL), 20 stream_(NULL),
21 connect_delegate_(connect_delegate) {} 21 connect_delegate_(connect_delegate) {}
22 22
23 WebSocketHandshakeStreamCreateHelper::~WebSocketHandshakeStreamCreateHelper() {} 23 WebSocketHandshakeStreamCreateHelper::~WebSocketHandshakeStreamCreateHelper() {}
24 24
25 WebSocketHandshakeStreamBase* 25 WebSocketHandshakeStreamBase*
26 WebSocketHandshakeStreamCreateHelper::CreateBasicStream( 26 WebSocketHandshakeStreamCreateHelper::CreateBasicStream(
27 scoped_ptr<ClientSocketHandle> connection, 27 scoped_ptr<ClientSocketHandle> connection,
28 bool using_proxy) { 28 bool using_proxy) {
29 // The list of supported extensions and parameters is hard-coded.
30 // TODO(ricea): If more extensions are added, consider a more flexible
31 // method.
32 std::vector<std::string> extensions(
33 1, "permessage-deflate; client_max_window_bits");
29 return stream_ = 34 return stream_ =
30 new WebSocketBasicHandshakeStream(connection.Pass(), 35 new WebSocketBasicHandshakeStream(connection.Pass(),
31 connect_delegate_, 36 connect_delegate_,
32 using_proxy, 37 using_proxy,
33 requested_subprotocols_, 38 requested_subprotocols_,
34 std::vector<std::string>()); 39 extensions);
35 } 40 }
36 41
37 // TODO(ricea): Create a WebSocketSpdyHandshakeStream. crbug.com/323852 42 // TODO(ricea): Create a WebSocketSpdyHandshakeStream. crbug.com/323852
38 WebSocketHandshakeStreamBase* 43 WebSocketHandshakeStreamBase*
39 WebSocketHandshakeStreamCreateHelper::CreateSpdyStream( 44 WebSocketHandshakeStreamCreateHelper::CreateSpdyStream(
40 const base::WeakPtr<SpdySession>& session, 45 const base::WeakPtr<SpdySession>& session,
41 bool use_relative_url) { 46 bool use_relative_url) {
42 NOTREACHED() << "Not implemented"; 47 NOTREACHED() << "Not implemented";
43 return NULL; 48 return NULL;
44 } 49 }
45 50
46 } // namespace net 51 } // namespace net
OLDNEW
« no previous file with comments | « net/websockets/websocket_basic_handshake_stream.cc ('k') | net/websockets/websocket_handshake_stream_create_helper_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698