| 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 447 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 458 HttpResponseBodyDrainer* drainer = new HttpResponseBodyDrainer(this); | 458 HttpResponseBodyDrainer* drainer = new HttpResponseBodyDrainer(this); |
| 459 drainer->Start(session); | 459 drainer->Start(session); |
| 460 // |drainer| will delete itself. | 460 // |drainer| will delete itself. |
| 461 } | 461 } |
| 462 | 462 |
| 463 void WebSocketBasicHandshakeStream::SetPriority(RequestPriority priority) { | 463 void WebSocketBasicHandshakeStream::SetPriority(RequestPriority priority) { |
| 464 // TODO(ricea): See TODO comment in HttpBasicStream::SetPriority(). If it is | 464 // TODO(ricea): See TODO comment in HttpBasicStream::SetPriority(). If it is |
| 465 // gone, then copy whatever has happened there over here. | 465 // gone, then copy whatever has happened there over here. |
| 466 } | 466 } |
| 467 | 467 |
| 468 UploadProgress WebSocketBasicHandshakeStream::GetUploadProgress() const { | |
| 469 return UploadProgress(); | |
| 470 } | |
| 471 | |
| 472 HttpStream* WebSocketBasicHandshakeStream::RenewStreamForAuth() { | 468 HttpStream* WebSocketBasicHandshakeStream::RenewStreamForAuth() { |
| 473 // Return null because we don't support renewing the stream. | 469 // Return null because we don't support renewing the stream. |
| 474 return nullptr; | 470 return nullptr; |
| 475 } | 471 } |
| 476 | 472 |
| 477 std::unique_ptr<WebSocketStream> WebSocketBasicHandshakeStream::Upgrade() { | 473 std::unique_ptr<WebSocketStream> WebSocketBasicHandshakeStream::Upgrade() { |
| 478 // The HttpStreamParser object has a pointer to our ClientSocketHandle. Make | 474 // The HttpStreamParser object has a pointer to our ClientSocketHandle. Make |
| 479 // sure it does not touch it again before it is destroyed. | 475 // sure it does not touch it again before it is destroyed. |
| 480 state_.DeleteParser(); | 476 state_.DeleteParser(); |
| 481 WebSocketTransportClientSocketPool::UnlockEndpoint(state_.connection()); | 477 WebSocketTransportClientSocketPool::UnlockEndpoint(state_.connection()); |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 595 } | 591 } |
| 596 OnFailure("Error during WebSocket handshake: " + failure_message); | 592 OnFailure("Error during WebSocket handshake: " + failure_message); |
| 597 return ERR_INVALID_RESPONSE; | 593 return ERR_INVALID_RESPONSE; |
| 598 } | 594 } |
| 599 | 595 |
| 600 void WebSocketBasicHandshakeStream::OnFailure(const std::string& message) { | 596 void WebSocketBasicHandshakeStream::OnFailure(const std::string& message) { |
| 601 stream_request_->OnFailure(message); | 597 stream_request_->OnFailure(message); |
| 602 } | 598 } |
| 603 | 599 |
| 604 } // namespace net | 600 } // namespace net |
| OLD | NEW |