Chromium Code Reviews| 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 570 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 581 return id <= largest_peer_created_stream_id_ && | 581 return id <= largest_peer_created_stream_id_ && |
| 582 implicitly_created_streams_.count(id) == 0; | 582 implicitly_created_streams_.count(id) == 0; |
| 583 } | 583 } |
| 584 | 584 |
| 585 size_t QuicSession::GetNumOpenStreams() const { | 585 size_t QuicSession::GetNumOpenStreams() const { |
| 586 return stream_map_.size() + implicitly_created_streams_.size() - | 586 return stream_map_.size() + implicitly_created_streams_.size() - |
| 587 zombie_streams_.size(); | 587 zombie_streams_.size(); |
| 588 } | 588 } |
| 589 | 589 |
| 590 void QuicSession::MarkWriteBlocked(QuicStreamId id, QuicPriority priority) { | 590 void QuicSession::MarkWriteBlocked(QuicStreamId id, QuicPriority priority) { |
| 591 #ifndef NDEBUG | |
| 592 ReliableQuicStream* stream = GetStream(id); | |
| 593 if (stream != nullptr) { | |
|
Ryan Hamilton
2014/01/14 00:39:58
I don't think we have nullptr yet. (This is my fa
ramant (doing other things)
2014/01/14 07:49:01
Sorry to have missed it.
Done.
| |
| 594 LOG_IF(DFATAL, priority != stream->EffectivePriority()) | |
| 595 << "Priorities do not match. Got: " << priority | |
| 596 << " Expected: " << stream->EffectivePriority(); | |
| 597 } else { | |
| 598 LOG(DFATAL) << "Marking unknown stream " << id << " blocked."; | |
| 599 } | |
| 600 #endif | |
| 601 | |
| 591 if (id == kCryptoStreamId) { | 602 if (id == kCryptoStreamId) { |
| 592 DCHECK(!has_pending_handshake_); | 603 DCHECK(!has_pending_handshake_); |
| 593 has_pending_handshake_ = true; | 604 has_pending_handshake_ = true; |
| 594 // TODO(jar): Be sure to use the highest priority for the crypto stream, | 605 // TODO(jar): Be sure to use the highest priority for the crypto stream, |
| 595 // perhaps by adding a "special" priority for it that is higher than | 606 // perhaps by adding a "special" priority for it that is higher than |
| 596 // kHighestPriority. | 607 // kHighestPriority. |
| 597 priority = kHighestPriority; | 608 priority = kHighestPriority; |
| 598 } | 609 } |
| 599 write_blocked_streams_.PushBack(id, priority); | 610 write_blocked_streams_.PushBack(id, priority); |
| 600 } | 611 } |
| (...skipping 13 matching lines...) Expand all Loading... | |
| 614 NOTIMPLEMENTED(); | 625 NOTIMPLEMENTED(); |
| 615 return false; | 626 return false; |
| 616 } | 627 } |
| 617 | 628 |
| 618 void QuicSession::PostProcessAfterData() { | 629 void QuicSession::PostProcessAfterData() { |
| 619 STLDeleteElements(&closed_streams_); | 630 STLDeleteElements(&closed_streams_); |
| 620 closed_streams_.clear(); | 631 closed_streams_.clear(); |
| 621 } | 632 } |
| 622 | 633 |
| 623 } // namespace net | 634 } // namespace net |
| OLD | NEW |