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/test_tools/quic_session_peer.h" | 5 #include "net/quic/test_tools/quic_session_peer.h" |
6 | 6 |
7 #include "base/stl_util.h" | 7 #include "base/stl_util.h" |
8 #include "net/quic/quic_session.h" | 8 #include "net/quic/quic_session.h" |
9 #include "net/quic/reliable_quic_stream.h" | 9 #include "net/quic/reliable_quic_stream.h" |
10 | 10 |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
65 return session->static_streams(); | 65 return session->static_streams(); |
66 } | 66 } |
67 | 67 |
68 // static | 68 // static |
69 std::unordered_set<QuicStreamId>* QuicSessionPeer::GetDrainingStreams( | 69 std::unordered_set<QuicStreamId>* QuicSessionPeer::GetDrainingStreams( |
70 QuicSession* session) { | 70 QuicSession* session) { |
71 return &session->draining_streams_; | 71 return &session->draining_streams_; |
72 } | 72 } |
73 | 73 |
74 // static | 74 // static |
| 75 void QuicSessionPeer::ActivateStream(QuicSession* session, |
| 76 ReliableQuicStream* stream) { |
| 77 return session->ActivateStream(stream); |
| 78 } |
| 79 |
| 80 // static |
75 bool QuicSessionPeer::IsStreamClosed(QuicSession* session, QuicStreamId id) { | 81 bool QuicSessionPeer::IsStreamClosed(QuicSession* session, QuicStreamId id) { |
76 DCHECK_NE(0u, id); | 82 DCHECK_NE(0u, id); |
77 return session->IsClosedStream(id); | 83 return session->IsClosedStream(id); |
78 } | 84 } |
79 | 85 |
80 // static | 86 // static |
81 bool QuicSessionPeer::IsStreamCreated(QuicSession* session, QuicStreamId id) { | 87 bool QuicSessionPeer::IsStreamCreated(QuicSession* session, QuicStreamId id) { |
82 DCHECK_NE(0u, id); | 88 DCHECK_NE(0u, id); |
83 return ContainsKey(session->dynamic_streams(), id); | 89 return ContainsKey(session->dynamic_streams(), id); |
84 } | 90 } |
(...skipping 11 matching lines...) Expand all Loading... |
96 // locally-created stream. | 102 // locally-created stream. |
97 return id >= session->next_outgoing_stream_id_; | 103 return id >= session->next_outgoing_stream_id_; |
98 } else { | 104 } else { |
99 // peer-created stream. | 105 // peer-created stream. |
100 return id > session->largest_peer_created_stream_id_; | 106 return id > session->largest_peer_created_stream_id_; |
101 } | 107 } |
102 } | 108 } |
103 | 109 |
104 } // namespace test | 110 } // namespace test |
105 } // namespace net | 111 } // namespace net |
OLD | NEW |