| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/quic/quic_session.h" | 5 #include "net/quic/quic_session.h" |
| 6 | 6 |
| 7 #include "base/stl_util.h" | 7 #include "base/stl_util.h" |
| 8 #include "net/quic/crypto/proof_verifier.h" | 8 #include "net/quic/crypto/proof_verifier.h" |
| 9 #include "net/quic/quic_connection.h" | 9 #include "net/quic/quic_connection.h" |
| 10 #include "net/quic/quic_headers_stream.h" | 10 #include "net/quic/quic_headers_stream.h" |
| (...skipping 546 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 557 DCHECK(!has_pending_handshake_); | 557 DCHECK(!has_pending_handshake_); |
| 558 has_pending_handshake_ = true; | 558 has_pending_handshake_ = true; |
| 559 // TODO(jar): Be sure to use the highest priority for the crypto stream, | 559 // TODO(jar): Be sure to use the highest priority for the crypto stream, |
| 560 // perhaps by adding a "special" priority for it that is higher than | 560 // perhaps by adding a "special" priority for it that is higher than |
| 561 // kHighestPriority. | 561 // kHighestPriority. |
| 562 priority = kHighestPriority; | 562 priority = kHighestPriority; |
| 563 } | 563 } |
| 564 write_blocked_streams_.PushBack(id, priority); | 564 write_blocked_streams_.PushBack(id, priority); |
| 565 } | 565 } |
| 566 | 566 |
| 567 void QuicSession::MarkFlowControlBlocked(QuicStreamId id, | |
| 568 QuicPriority priority) { | |
| 569 ReliableQuicStream* stream = GetStream(id); | |
| 570 if (stream == NULL) { | |
| 571 LOG(DFATAL) << "Trying to mark nonexistent stream " << id | |
| 572 << " flow control blocked."; | |
| 573 return; | |
| 574 } | |
| 575 | |
| 576 // Send a BLOCKED frame to peer. | |
| 577 connection()->SendBlocked(id); | |
| 578 } | |
| 579 | |
| 580 bool QuicSession::HasDataToWrite() const { | 567 bool QuicSession::HasDataToWrite() const { |
| 581 return write_blocked_streams_.HasWriteBlockedStreams() || | 568 return write_blocked_streams_.HasWriteBlockedStreams() || |
| 582 connection_->HasQueuedData(); | 569 connection_->HasQueuedData(); |
| 583 } | 570 } |
| 584 | 571 |
| 585 bool QuicSession::GetSSLInfo(SSLInfo* ssl_info) const { | 572 bool QuicSession::GetSSLInfo(SSLInfo* ssl_info) const { |
| 586 NOTIMPLEMENTED(); | 573 NOTIMPLEMENTED(); |
| 587 return false; | 574 return false; |
| 588 } | 575 } |
| 589 | 576 |
| 590 void QuicSession::PostProcessAfterData() { | 577 void QuicSession::PostProcessAfterData() { |
| 591 STLDeleteElements(&closed_streams_); | 578 STLDeleteElements(&closed_streams_); |
| 592 closed_streams_.clear(); | 579 closed_streams_.clear(); |
| 593 } | 580 } |
| 594 | 581 |
| 595 } // namespace net | 582 } // namespace net |
| OLD | NEW |