| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/p2p/quic_p2p_session.h" | 5 #include "net/quic/p2p/quic_p2p_session.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/callback_helpers.h" | 9 #include "base/callback_helpers.h" |
| 10 #include "net/base/io_buffer.h" | 10 #include "net/base/io_buffer.h" |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 48 | 48 |
| 49 QuicCryptoStream* QuicP2PSession::GetCryptoStream() { | 49 QuicCryptoStream* QuicP2PSession::GetCryptoStream() { |
| 50 return crypto_stream_.get(); | 50 return crypto_stream_.get(); |
| 51 } | 51 } |
| 52 | 52 |
| 53 QuicP2PStream* QuicP2PSession::CreateIncomingDynamicStream(QuicStreamId id) { | 53 QuicP2PStream* QuicP2PSession::CreateIncomingDynamicStream(QuicStreamId id) { |
| 54 QuicP2PStream* stream = new QuicP2PStream(id, this); | 54 QuicP2PStream* stream = new QuicP2PStream(id, this); |
| 55 if (delegate_) { | 55 if (delegate_) { |
| 56 delegate_->OnIncomingStream(stream); | 56 delegate_->OnIncomingStream(stream); |
| 57 } | 57 } |
| 58 ActivateStream(stream); |
| 58 return stream; | 59 return stream; |
| 59 } | 60 } |
| 60 | 61 |
| 61 QuicP2PStream* QuicP2PSession::CreateOutgoingDynamicStream( | 62 QuicP2PStream* QuicP2PSession::CreateOutgoingDynamicStream( |
| 62 SpdyPriority priority) { | 63 SpdyPriority priority) { |
| 63 QuicP2PStream* stream = new QuicP2PStream(GetNextOutgoingStreamId(), this); | 64 QuicP2PStream* stream = new QuicP2PStream(GetNextOutgoingStreamId(), this); |
| 64 if (stream) { | 65 if (stream) { |
| 65 ActivateStream(stream); | 66 ActivateStream(stream); |
| 66 } | 67 } |
| 67 return stream; | 68 return stream; |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 123 return result; | 124 return result; |
| 124 } | 125 } |
| 125 | 126 |
| 126 QuicEncryptedPacket packet(read_buffer_->data(), result); | 127 QuicEncryptedPacket packet(read_buffer_->data(), result); |
| 127 connection()->ProcessUdpPacket(connection()->self_address(), | 128 connection()->ProcessUdpPacket(connection()->self_address(), |
| 128 connection()->peer_address(), packet); | 129 connection()->peer_address(), packet); |
| 129 return OK; | 130 return OK; |
| 130 } | 131 } |
| 131 | 132 |
| 132 } // namespace net | 133 } // namespace net |
| OLD | NEW |