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 <algorithm> | 7 #include <algorithm> |
8 #include <iterator> | 8 #include <iterator> |
9 #include <set> | 9 #include <set> |
10 #include <string> | 10 #include <string> |
(...skipping 420 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
431 parser()->GetSSLCertRequestInfo(cert_request_info); | 431 parser()->GetSSLCertRequestInfo(cert_request_info); |
432 } | 432 } |
433 | 433 |
434 bool WebSocketBasicHandshakeStream::GetRemoteEndpoint(IPEndPoint* endpoint) { | 434 bool WebSocketBasicHandshakeStream::GetRemoteEndpoint(IPEndPoint* endpoint) { |
435 if (!state_.connection() || !state_.connection()->socket()) | 435 if (!state_.connection() || !state_.connection()->socket()) |
436 return false; | 436 return false; |
437 | 437 |
438 return state_.connection()->socket()->GetPeerAddress(endpoint) == OK; | 438 return state_.connection()->socket()->GetPeerAddress(endpoint) == OK; |
439 } | 439 } |
440 | 440 |
| 441 int WebSocketBasicHandshakeStream::GetTokenBindingMessageHeader( |
| 442 std::string* out) { |
| 443 return parser()->GetTokenBindingMessageHeader(out); |
| 444 } |
| 445 |
441 void WebSocketBasicHandshakeStream::Drain(HttpNetworkSession* session) { | 446 void WebSocketBasicHandshakeStream::Drain(HttpNetworkSession* session) { |
442 HttpResponseBodyDrainer* drainer = new HttpResponseBodyDrainer(this); | 447 HttpResponseBodyDrainer* drainer = new HttpResponseBodyDrainer(this); |
443 drainer->Start(session); | 448 drainer->Start(session); |
444 // |drainer| will delete itself. | 449 // |drainer| will delete itself. |
445 } | 450 } |
446 | 451 |
447 void WebSocketBasicHandshakeStream::SetPriority(RequestPriority priority) { | 452 void WebSocketBasicHandshakeStream::SetPriority(RequestPriority priority) { |
448 // TODO(ricea): See TODO comment in HttpBasicStream::SetPriority(). If it is | 453 // TODO(ricea): See TODO comment in HttpBasicStream::SetPriority(). If it is |
449 // gone, then copy whatever has happened there over here. | 454 // gone, then copy whatever has happened there over here. |
450 } | 455 } |
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
584 set_failure_message("Error during WebSocket handshake: " + failure_message); | 589 set_failure_message("Error during WebSocket handshake: " + failure_message); |
585 return ERR_INVALID_RESPONSE; | 590 return ERR_INVALID_RESPONSE; |
586 } | 591 } |
587 | 592 |
588 void WebSocketBasicHandshakeStream::set_failure_message( | 593 void WebSocketBasicHandshakeStream::set_failure_message( |
589 const std::string& failure_message) { | 594 const std::string& failure_message) { |
590 *failure_message_ = failure_message; | 595 *failure_message_ = failure_message; |
591 } | 596 } |
592 | 597 |
593 } // namespace net | 598 } // namespace net |
OLD | NEW |