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

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

Issue 1545233002: Convert Pass()→std::move() in //net (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 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 <utility>
8
7 #include "base/logging.h" 9 #include "base/logging.h"
8 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
9 #include "base/memory/weak_ptr.h" 11 #include "base/memory/weak_ptr.h"
10 #include "net/socket/client_socket_handle.h" 12 #include "net/socket/client_socket_handle.h"
11 #include "net/spdy/spdy_session.h" 13 #include "net/spdy/spdy_session.h"
12 #include "net/websockets/websocket_basic_handshake_stream.h" 14 #include "net/websockets/websocket_basic_handshake_stream.h"
13 15
14 namespace net { 16 namespace net {
15 17
16 WebSocketHandshakeStreamCreateHelper::WebSocketHandshakeStreamCreateHelper( 18 WebSocketHandshakeStreamCreateHelper::WebSocketHandshakeStreamCreateHelper(
(...skipping 11 matching lines...) Expand all
28 WebSocketHandshakeStreamBase* 30 WebSocketHandshakeStreamBase*
29 WebSocketHandshakeStreamCreateHelper::CreateBasicStream( 31 WebSocketHandshakeStreamCreateHelper::CreateBasicStream(
30 scoped_ptr<ClientSocketHandle> connection, 32 scoped_ptr<ClientSocketHandle> connection,
31 bool using_proxy) { 33 bool using_proxy) {
32 DCHECK(failure_message_) << "set_failure_message() must be called"; 34 DCHECK(failure_message_) << "set_failure_message() must be called";
33 // The list of supported extensions and parameters is hard-coded. 35 // The list of supported extensions and parameters is hard-coded.
34 // TODO(ricea): If more extensions are added, consider a more flexible 36 // TODO(ricea): If more extensions are added, consider a more flexible
35 // method. 37 // method.
36 std::vector<std::string> extensions( 38 std::vector<std::string> extensions(
37 1, "permessage-deflate; client_max_window_bits"); 39 1, "permessage-deflate; client_max_window_bits");
38 WebSocketBasicHandshakeStream* stream = 40 WebSocketBasicHandshakeStream* stream = new WebSocketBasicHandshakeStream(
39 new WebSocketBasicHandshakeStream(connection.Pass(), 41 std::move(connection), connect_delegate_, using_proxy,
40 connect_delegate_, 42 requested_subprotocols_, extensions, failure_message_);
41 using_proxy,
42 requested_subprotocols_,
43 extensions,
44 failure_message_);
45 OnStreamCreated(stream); 43 OnStreamCreated(stream);
46 stream_ = stream; 44 stream_ = stream;
47 return stream; 45 return stream;
48 } 46 }
49 47
50 // TODO(ricea): Create a WebSocketSpdyHandshakeStream. crbug.com/323852 48 // TODO(ricea): Create a WebSocketSpdyHandshakeStream. crbug.com/323852
51 WebSocketHandshakeStreamBase* 49 WebSocketHandshakeStreamBase*
52 WebSocketHandshakeStreamCreateHelper::CreateSpdyStream( 50 WebSocketHandshakeStreamCreateHelper::CreateSpdyStream(
53 const base::WeakPtr<SpdySession>& session, 51 const base::WeakPtr<SpdySession>& session,
54 bool use_relative_url) { 52 bool use_relative_url) {
55 NOTREACHED() << "Not implemented"; 53 NOTREACHED() << "Not implemented";
56 return NULL; 54 return NULL;
57 } 55 }
58 56
59 scoped_ptr<WebSocketStream> WebSocketHandshakeStreamCreateHelper::Upgrade() { 57 scoped_ptr<WebSocketStream> WebSocketHandshakeStreamCreateHelper::Upgrade() {
60 DCHECK(stream_); 58 DCHECK(stream_);
61 WebSocketHandshakeStreamBase* stream = stream_; 59 WebSocketHandshakeStreamBase* stream = stream_;
62 stream_ = NULL; 60 stream_ = NULL;
63 return stream->Upgrade(); 61 return stream->Upgrade();
64 } 62 }
65 63
66 void WebSocketHandshakeStreamCreateHelper::OnStreamCreated( 64 void WebSocketHandshakeStreamCreateHelper::OnStreamCreated(
67 WebSocketBasicHandshakeStream* stream) { 65 WebSocketBasicHandshakeStream* stream) {
68 } 66 }
69 67
70 } // namespace net 68 } // namespace net
OLDNEW
« no previous file with comments | « net/websockets/websocket_frame_parser.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