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

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

Issue 2255883002: Pass ClientSocketHandle ownership around in unique_ptr. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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
« no previous file with comments | « net/http/http_stream_factory_impl_job_controller_unittest.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_basic_handshake_stream.h" 5 #include "net/websockets/websocket_basic_handshake_stream.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <algorithm> 8 #include <algorithm>
9 #include <iterator> 9 #include <iterator>
10 #include <set> 10 #include <set>
(...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after
288 288
289 } // namespace 289 } // namespace
290 290
291 WebSocketBasicHandshakeStream::WebSocketBasicHandshakeStream( 291 WebSocketBasicHandshakeStream::WebSocketBasicHandshakeStream(
292 std::unique_ptr<ClientSocketHandle> connection, 292 std::unique_ptr<ClientSocketHandle> connection,
293 WebSocketStream::ConnectDelegate* connect_delegate, 293 WebSocketStream::ConnectDelegate* connect_delegate,
294 bool using_proxy, 294 bool using_proxy,
295 std::vector<std::string> requested_sub_protocols, 295 std::vector<std::string> requested_sub_protocols,
296 std::vector<std::string> requested_extensions, 296 std::vector<std::string> requested_extensions,
297 WebSocketStreamRequest* request) 297 WebSocketStreamRequest* request)
298 : state_(connection.release(), using_proxy), 298 : state_(std::move(connection), using_proxy),
299 connect_delegate_(connect_delegate), 299 connect_delegate_(connect_delegate),
300 http_response_info_(nullptr), 300 http_response_info_(nullptr),
301 requested_sub_protocols_(requested_sub_protocols), 301 requested_sub_protocols_(requested_sub_protocols),
302 requested_extensions_(requested_extensions), 302 requested_extensions_(requested_extensions),
303 stream_request_(request) { 303 stream_request_(request) {
304 DCHECK(connect_delegate); 304 DCHECK(connect_delegate);
305 DCHECK(request); 305 DCHECK(request);
306 } 306 }
307 307
308 WebSocketBasicHandshakeStream::~WebSocketBasicHandshakeStream() {} 308 WebSocketBasicHandshakeStream::~WebSocketBasicHandshakeStream() {}
(...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after
593 } 593 }
594 OnFailure("Error during WebSocket handshake: " + failure_message); 594 OnFailure("Error during WebSocket handshake: " + failure_message);
595 return ERR_INVALID_RESPONSE; 595 return ERR_INVALID_RESPONSE;
596 } 596 }
597 597
598 void WebSocketBasicHandshakeStream::OnFailure(const std::string& message) { 598 void WebSocketBasicHandshakeStream::OnFailure(const std::string& message) {
599 stream_request_->OnFailure(message); 599 stream_request_->OnFailure(message);
600 } 600 }
601 601
602 } // namespace net 602 } // namespace net
OLDNEW
« no previous file with comments | « net/http/http_stream_factory_impl_job_controller_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698