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 13 matching lines...) Expand all Loading... |
24 #include "base/strings/string_piece.h" | 24 #include "base/strings/string_piece.h" |
25 #include "base/strings/string_util.h" | 25 #include "base/strings/string_util.h" |
26 #include "base/strings/stringprintf.h" | 26 #include "base/strings/stringprintf.h" |
27 #include "base/time/time.h" | 27 #include "base/time/time.h" |
28 #include "crypto/random.h" | 28 #include "crypto/random.h" |
29 #include "net/base/io_buffer.h" | 29 #include "net/base/io_buffer.h" |
30 #include "net/http/http_request_headers.h" | 30 #include "net/http/http_request_headers.h" |
31 #include "net/http/http_request_info.h" | 31 #include "net/http/http_request_info.h" |
32 #include "net/http/http_response_body_drainer.h" | 32 #include "net/http/http_response_body_drainer.h" |
33 #include "net/http/http_response_headers.h" | 33 #include "net/http/http_response_headers.h" |
| 34 #include "net/http/http_response_info.h" |
34 #include "net/http/http_status_code.h" | 35 #include "net/http/http_status_code.h" |
35 #include "net/http/http_stream_parser.h" | 36 #include "net/http/http_stream_parser.h" |
36 #include "net/socket/client_socket_handle.h" | 37 #include "net/socket/client_socket_handle.h" |
37 #include "net/socket/websocket_transport_client_socket_pool.h" | 38 #include "net/socket/websocket_transport_client_socket_pool.h" |
38 #include "net/websockets/websocket_basic_stream.h" | 39 #include "net/websockets/websocket_basic_stream.h" |
39 #include "net/websockets/websocket_deflate_parameters.h" | 40 #include "net/websockets/websocket_deflate_parameters.h" |
40 #include "net/websockets/websocket_deflate_predictor.h" | 41 #include "net/websockets/websocket_deflate_predictor.h" |
41 #include "net/websockets/websocket_deflate_predictor_impl.h" | 42 #include "net/websockets/websocket_deflate_predictor_impl.h" |
42 #include "net/websockets/websocket_deflate_stream.h" | 43 #include "net/websockets/websocket_deflate_stream.h" |
43 #include "net/websockets/websocket_deflater.h" | 44 #include "net/websockets/websocket_deflater.h" |
(...skipping 400 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
444 return; | 445 return; |
445 } | 446 } |
446 | 447 |
447 Error WebSocketBasicHandshakeStream::GetSignedEKMForTokenBinding( | 448 Error WebSocketBasicHandshakeStream::GetSignedEKMForTokenBinding( |
448 crypto::ECPrivateKey* key, | 449 crypto::ECPrivateKey* key, |
449 std::vector<uint8_t>* out) { | 450 std::vector<uint8_t>* out) { |
450 NOTREACHED(); | 451 NOTREACHED(); |
451 return ERR_NOT_IMPLEMENTED; | 452 return ERR_NOT_IMPLEMENTED; |
452 } | 453 } |
453 | 454 |
454 void WebSocketBasicHandshakeStream::Drain(HttpNetworkSession* session) { | 455 void WebSocketBasicHandshakeStream::Drain( |
455 HttpResponseBodyDrainer* drainer = new HttpResponseBodyDrainer(this); | 456 HttpNetworkSession* session, |
456 drainer->Start(session); | 457 scoped_ptr<HttpResponseInfo> response_info) { |
457 // |drainer| will delete itself. | 458 NOTREACHED(); |
458 } | 459 } |
459 | 460 |
460 void WebSocketBasicHandshakeStream::SetPriority(RequestPriority priority) { | 461 void WebSocketBasicHandshakeStream::SetPriority(RequestPriority priority) { |
461 // TODO(ricea): See TODO comment in HttpBasicStream::SetPriority(). If it is | 462 // TODO(ricea): See TODO comment in HttpBasicStream::SetPriority(). If it is |
462 // gone, then copy whatever has happened there over here. | 463 // gone, then copy whatever has happened there over here. |
463 } | 464 } |
464 | 465 |
465 UploadProgress WebSocketBasicHandshakeStream::GetUploadProgress() const { | 466 UploadProgress WebSocketBasicHandshakeStream::GetUploadProgress() const { |
466 return UploadProgress(); | 467 return UploadProgress(); |
467 } | 468 } |
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
597 set_failure_message("Error during WebSocket handshake: " + failure_message); | 598 set_failure_message("Error during WebSocket handshake: " + failure_message); |
598 return ERR_INVALID_RESPONSE; | 599 return ERR_INVALID_RESPONSE; |
599 } | 600 } |
600 | 601 |
601 void WebSocketBasicHandshakeStream::set_failure_message( | 602 void WebSocketBasicHandshakeStream::set_failure_message( |
602 const std::string& failure_message) { | 603 const std::string& failure_message) { |
603 *failure_message_ = failure_message; | 604 *failure_message_ = failure_message; |
604 } | 605 } |
605 | 606 |
606 } // namespace net | 607 } // namespace net |
OLD | NEW |