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 512 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
523 HttpResponseBodyDrainer* drainer = new HttpResponseBodyDrainer(this); | 523 HttpResponseBodyDrainer* drainer = new HttpResponseBodyDrainer(this); |
524 drainer->Start(session); | 524 drainer->Start(session); |
525 // |drainer| will delete itself. | 525 // |drainer| will delete itself. |
526 } | 526 } |
527 | 527 |
528 void WebSocketBasicHandshakeStream::SetPriority(RequestPriority priority) { | 528 void WebSocketBasicHandshakeStream::SetPriority(RequestPriority priority) { |
529 // TODO(ricea): See TODO comment in HttpBasicStream::SetPriority(). If it is | 529 // TODO(ricea): See TODO comment in HttpBasicStream::SetPriority(). If it is |
530 // gone, then copy whatever has happened there over here. | 530 // gone, then copy whatever has happened there over here. |
531 } | 531 } |
532 | 532 |
533 UploadProgress WebSocketBasicHandshakeStream::GetUploadProgress() const { | |
534 return UploadProgress(); | |
535 } | |
536 | |
537 HttpStream* WebSocketBasicHandshakeStream::RenewStreamForAuth() { | |
538 // Return null because we don't support renewing the stream. | |
539 return nullptr; | |
tyoshino (SeeGerritForStatus)
2014/11/04 17:03:58
use NULL for consistency with the other places whe
yhirano
2014/11/05 02:19:50
Then I would rather use nullptr than NULL.
Replace
| |
540 } | |
541 | |
533 scoped_ptr<WebSocketStream> WebSocketBasicHandshakeStream::Upgrade() { | 542 scoped_ptr<WebSocketStream> WebSocketBasicHandshakeStream::Upgrade() { |
534 // The HttpStreamParser object has a pointer to our ClientSocketHandle. Make | 543 // The HttpStreamParser object has a pointer to our ClientSocketHandle. Make |
535 // sure it does not touch it again before it is destroyed. | 544 // sure it does not touch it again before it is destroyed. |
536 state_.DeleteParser(); | 545 state_.DeleteParser(); |
537 WebSocketTransportClientSocketPool::UnlockEndpoint(state_.connection()); | 546 WebSocketTransportClientSocketPool::UnlockEndpoint(state_.connection()); |
538 scoped_ptr<WebSocketStream> basic_stream( | 547 scoped_ptr<WebSocketStream> basic_stream( |
539 new WebSocketBasicStream(state_.ReleaseConnection(), | 548 new WebSocketBasicStream(state_.ReleaseConnection(), |
540 state_.read_buf(), | 549 state_.read_buf(), |
541 sub_protocol_, | 550 sub_protocol_, |
542 extensions_)); | 551 extensions_)); |
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
670 set_failure_message("Error during WebSocket handshake: " + failure_message); | 679 set_failure_message("Error during WebSocket handshake: " + failure_message); |
671 return ERR_INVALID_RESPONSE; | 680 return ERR_INVALID_RESPONSE; |
672 } | 681 } |
673 | 682 |
674 void WebSocketBasicHandshakeStream::set_failure_message( | 683 void WebSocketBasicHandshakeStream::set_failure_message( |
675 const std::string& failure_message) { | 684 const std::string& failure_message) { |
676 *failure_message_ = failure_message; | 685 *failure_message_ = failure_message; |
677 } | 686 } |
678 | 687 |
679 } // namespace net | 688 } // namespace net |
OLD | NEW |