OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright 2016 The WebRTC Project Authors. All rights reserved. | 2 * Copyright 2016 The WebRTC Project Authors. All rights reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
68 if (stream) { | 68 if (stream) { |
69 SignalIncomingStream(stream); | 69 SignalIncomingStream(stream); |
70 } | 70 } |
71 return stream; | 71 return stream; |
72 } | 72 } |
73 | 73 |
74 ReliableQuicStream* QuicSession::CreateOutgoingDynamicStream( | 74 ReliableQuicStream* QuicSession::CreateOutgoingDynamicStream( |
75 net::SpdyPriority priority) { | 75 net::SpdyPriority priority) { |
76 ReliableQuicStream* stream = CreateDataStream(GetNextOutgoingStreamId()); | 76 ReliableQuicStream* stream = CreateDataStream(GetNextOutgoingStreamId()); |
77 if (stream) { | 77 if (stream) { |
78 ActivateStream(stream); | 78 ActivateStream(stream); // QuicSession owns the stream |
79 // Register the stream to the QuicWriteBlockedList. |priority| is clamped | |
80 // between 0 and 7, with 0 being the highest priority and 7 the lowest | |
81 // priority. | |
82 // write_blocked_streams()->RegisterStream(stream->id(), priority); | |
pthatcher1
2016/03/30 20:34:50
What is this commented-out line?
mikescarlett
2016/04/05 19:58:53
Removed. I was originally intending to allow setti
| |
79 } | 83 } |
80 return stream; | 84 return stream; |
81 } | 85 } |
82 | 86 |
83 ReliableQuicStream* QuicSession::CreateDataStream(net::QuicStreamId id) { | 87 ReliableQuicStream* QuicSession::CreateDataStream(net::QuicStreamId id) { |
84 if (crypto_stream_ == nullptr || !crypto_stream_->encryption_established()) { | 88 if (crypto_stream_ == nullptr || !crypto_stream_->encryption_established()) { |
85 // Encryption not active so no stream created | 89 return nullptr; // Encryption not active so no stream created |
86 return nullptr; | |
87 } | 90 } |
88 return new ReliableQuicStream(id, this); | 91 return new ReliableQuicStream(id, this); |
89 } | 92 } |
90 | 93 |
91 void QuicSession::OnConnectionClosed(net::QuicErrorCode error, | 94 void QuicSession::OnConnectionClosed(net::QuicErrorCode error, |
92 net::ConnectionCloseSource source) { | 95 net::ConnectionCloseSource source) { |
93 net::QuicSession::OnConnectionClosed(error, source); | 96 net::QuicSession::OnConnectionClosed(error, source); |
94 SignalConnectionClosed(error, | 97 SignalConnectionClosed(error, |
95 source == net::ConnectionCloseSource::FROM_PEER); | 98 source == net::ConnectionCloseSource::FROM_PEER); |
96 } | 99 } |
97 | 100 |
98 bool QuicSession::OnReadPacket(const char* data, size_t data_len) { | 101 bool QuicSession::OnReadPacket(const char* data, size_t data_len) { |
99 net::QuicEncryptedPacket packet(data, data_len); | 102 net::QuicEncryptedPacket packet(data, data_len); |
100 connection()->ProcessUdpPacket(connection()->self_address(), | 103 connection()->ProcessUdpPacket(connection()->self_address(), |
101 connection()->peer_address(), packet); | 104 connection()->peer_address(), packet); |
102 return true; | 105 return true; |
103 } | 106 } |
104 | 107 |
108 void QuicSession::CloseStream(net::QuicStreamId stream_id) { | |
109 // write_blocked_streams()->UnregisterStream(stream_id); | |
110 net::QuicSession::CloseStream(stream_id); | |
111 } | |
112 | |
105 } // namespace cricket | 113 } // namespace cricket |
OLD | NEW |