| 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 "base/callback_helpers.h" | 7 #include "base/callback_helpers.h" |
| 8 #include "net/base/io_buffer.h" | 8 #include "net/base/io_buffer.h" |
| 9 #include "net/base/net_errors.h" | 9 #include "net/base/net_errors.h" |
| 10 #include "net/quic/p2p/quic_p2p_crypto_stream.h" | 10 #include "net/quic/p2p/quic_p2p_crypto_stream.h" |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 | 50 |
| 51 QuicP2PStream* QuicP2PSession::CreateIncomingDynamicStream(QuicStreamId id) { | 51 QuicP2PStream* QuicP2PSession::CreateIncomingDynamicStream(QuicStreamId id) { |
| 52 QuicP2PStream* stream = new QuicP2PStream(id, this); | 52 QuicP2PStream* stream = new QuicP2PStream(id, this); |
| 53 if (delegate_) { | 53 if (delegate_) { |
| 54 delegate_->OnIncomingStream(stream); | 54 delegate_->OnIncomingStream(stream); |
| 55 } | 55 } |
| 56 return stream; | 56 return stream; |
| 57 } | 57 } |
| 58 | 58 |
| 59 QuicP2PStream* QuicP2PSession::CreateOutgoingDynamicStream() { | 59 QuicP2PStream* QuicP2PSession::CreateOutgoingDynamicStream() { |
| 60 QuicP2PStream* stream = new QuicP2PStream(GetNextStreamId(), this); | 60 QuicP2PStream* stream = new QuicP2PStream(GetNextOutgoingStreamId(), this); |
| 61 if (stream) { | 61 if (stream) { |
| 62 ActivateStream(stream); | 62 ActivateStream(stream); |
| 63 } | 63 } |
| 64 return stream; | 64 return stream; |
| 65 } | 65 } |
| 66 | 66 |
| 67 void QuicP2PSession::OnConnectionClosed(QuicErrorCode error, bool from_peer) { | 67 void QuicP2PSession::OnConnectionClosed(QuicErrorCode error, bool from_peer) { |
| 68 QuicSession::OnConnectionClosed(error, from_peer); | 68 QuicSession::OnConnectionClosed(error, from_peer); |
| 69 | 69 |
| 70 socket_.reset(); | 70 socket_.reset(); |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 118 return result; | 118 return result; |
| 119 } | 119 } |
| 120 | 120 |
| 121 QuicEncryptedPacket packet(read_buffer_->data(), result); | 121 QuicEncryptedPacket packet(read_buffer_->data(), result); |
| 122 connection()->ProcessUdpPacket(connection()->self_address(), | 122 connection()->ProcessUdpPacket(connection()->self_address(), |
| 123 connection()->peer_address(), packet); | 123 connection()->peer_address(), packet); |
| 124 return OK; | 124 return OK; |
| 125 } | 125 } |
| 126 | 126 |
| 127 } // namespace net | 127 } // namespace net |
| OLD | NEW |