| 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 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::GetProvidedTokenBindingWithKey( |
| 442 const scoped_ptr<crypto::ECPrivateKey>& key, |
| 443 std::string* header_out) { |
| 444 NOTREACHED(); |
| 445 return ERR_NOT_IMPLEMENTED; |
| 446 } |
| 447 |
| 441 void WebSocketBasicHandshakeStream::Drain(HttpNetworkSession* session) { | 448 void WebSocketBasicHandshakeStream::Drain(HttpNetworkSession* session) { |
| 442 HttpResponseBodyDrainer* drainer = new HttpResponseBodyDrainer(this); | 449 HttpResponseBodyDrainer* drainer = new HttpResponseBodyDrainer(this); |
| 443 drainer->Start(session); | 450 drainer->Start(session); |
| 444 // |drainer| will delete itself. | 451 // |drainer| will delete itself. |
| 445 } | 452 } |
| 446 | 453 |
| 447 void WebSocketBasicHandshakeStream::SetPriority(RequestPriority priority) { | 454 void WebSocketBasicHandshakeStream::SetPriority(RequestPriority priority) { |
| 448 // TODO(ricea): See TODO comment in HttpBasicStream::SetPriority(). If it is | 455 // TODO(ricea): See TODO comment in HttpBasicStream::SetPriority(). If it is |
| 449 // gone, then copy whatever has happened there over here. | 456 // gone, then copy whatever has happened there over here. |
| 450 } | 457 } |
| (...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 584 set_failure_message("Error during WebSocket handshake: " + failure_message); | 591 set_failure_message("Error during WebSocket handshake: " + failure_message); |
| 585 return ERR_INVALID_RESPONSE; | 592 return ERR_INVALID_RESPONSE; |
| 586 } | 593 } |
| 587 | 594 |
| 588 void WebSocketBasicHandshakeStream::set_failure_message( | 595 void WebSocketBasicHandshakeStream::set_failure_message( |
| 589 const std::string& failure_message) { | 596 const std::string& failure_message) { |
| 590 *failure_message_ = failure_message; | 597 *failure_message_ = failure_message; |
| 591 } | 598 } |
| 592 | 599 |
| 593 } // namespace net | 600 } // namespace net |
| OLD | NEW |