OLD | NEW |
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 Loading... |
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_(std::move(connection), | 298 : state_(std::move(connection), using_proxy), |
299 using_proxy, | |
300 false /* http_09_on_non_default_ports_enabled */), | |
301 connect_delegate_(connect_delegate), | 299 connect_delegate_(connect_delegate), |
302 http_response_info_(nullptr), | 300 http_response_info_(nullptr), |
303 requested_sub_protocols_(requested_sub_protocols), | 301 requested_sub_protocols_(requested_sub_protocols), |
304 requested_extensions_(requested_extensions), | 302 requested_extensions_(requested_extensions), |
305 stream_request_(request) { | 303 stream_request_(request) { |
306 DCHECK(connect_delegate); | 304 DCHECK(connect_delegate); |
307 DCHECK(request); | 305 DCHECK(request); |
308 } | 306 } |
309 | 307 |
310 WebSocketBasicHandshakeStream::~WebSocketBasicHandshakeStream() {} | 308 WebSocketBasicHandshakeStream::~WebSocketBasicHandshakeStream() {} |
(...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
595 } | 593 } |
596 OnFailure("Error during WebSocket handshake: " + failure_message); | 594 OnFailure("Error during WebSocket handshake: " + failure_message); |
597 return ERR_INVALID_RESPONSE; | 595 return ERR_INVALID_RESPONSE; |
598 } | 596 } |
599 | 597 |
600 void WebSocketBasicHandshakeStream::OnFailure(const std::string& message) { | 598 void WebSocketBasicHandshakeStream::OnFailure(const std::string& message) { |
601 stream_request_->OnFailure(message); | 599 stream_request_->OnFailure(message); |
602 } | 600 } |
603 | 601 |
604 } // namespace net | 602 } // namespace net |
OLD | NEW |