diff options
author | ricea@chromium.org <ricea@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-11-29 02:55:05 +0000 |
---|---|---|
committer | ricea@chromium.org <ricea@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-11-29 02:55:05 +0000 |
commit | efa9e7375c48f046504be3f7317ff302cb85ff8c (patch) | |
tree | 9409e3fb79a8b739db65c6dbaa38e0ddb3b0943c /net/websockets/websocket_handshake_stream_create_helper.cc | |
parent | 4ef22eb238ac3d884e21e55d66f4d3cee65bd902 (diff) | |
download | chromium_src-efa9e7375c48f046504be3f7317ff302cb85ff8c.zip chromium_src-efa9e7375c48f046504be3f7317ff302cb85ff8c.tar.gz chromium_src-efa9e7375c48f046504be3f7317ff302cb85ff8c.tar.bz2 |
WebSocketHandshakeStreamCreateHelper is an internal class that stores the data that is needed to create a WebSocketBasicHandshakeStream.
This CL also adds a real implementation of WebSocketStream::CreateAndConnectStream().
This CL depends on https://codereview.chromium.org/23500007/ to compile.
The tests for this CL are in https://codereview.chromium.org/64133006/
BUG=265329
Review URL: https://codereview.chromium.org/21011003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@237865 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 | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/net/websockets/websocket_handshake_stream_create_helper.cc b/net/websockets/websocket_handshake_stream_create_helper.cc new file mode 100644 index 0000000..8f1060c --- /dev/null +++ b/net/websockets/websocket_handshake_stream_create_helper.cc @@ -0,0 +1,43 @@ +// Copyright 2013 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "net/websockets/websocket_handshake_stream_create_helper.h" + +#include "base/logging.h" +#include "base/memory/scoped_ptr.h" +#include "base/memory/weak_ptr.h" +#include "net/socket/client_socket_handle.h" +#include "net/spdy/spdy_session.h" +#include "net/websockets/websocket_basic_handshake_stream.h" + +namespace net { + +WebSocketHandshakeStreamCreateHelper::WebSocketHandshakeStreamCreateHelper( + const std::vector<std::string>& requested_subprotocols) + : requested_subprotocols_(requested_subprotocols), + stream_(NULL) {} + +WebSocketHandshakeStreamCreateHelper::~WebSocketHandshakeStreamCreateHelper() {} + +WebSocketHandshakeStreamBase* +WebSocketHandshakeStreamCreateHelper::CreateBasicStream( + scoped_ptr<ClientSocketHandle> connection, + bool using_proxy) { + return stream_ = + new WebSocketBasicHandshakeStream(connection.Pass(), + using_proxy, + requested_subprotocols_, + std::vector<std::string>()); +} + +// TODO(ricea): Create a WebSocketSpdyHandshakeStream. crbug.com/323852 +WebSocketHandshakeStreamBase* +WebSocketHandshakeStreamCreateHelper::CreateSpdyStream( + const base::WeakPtr<SpdySession>& session, + bool use_relative_url) { + NOTREACHED() << "Not implemented"; + return NULL; +} + +} // namespace net |