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 "base/location.h" | 10 #include "base/location.h" |
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
222 session2_ = CreateP2PSession(std::move(socket2), crypto_config, | 222 session2_ = CreateP2PSession(std::move(socket2), crypto_config, |
223 Perspective::IS_CLIENT); | 223 Perspective::IS_CLIENT); |
224 } | 224 } |
225 | 225 |
226 scoped_ptr<QuicP2PSession> CreateP2PSession(scoped_ptr<Socket> socket, | 226 scoped_ptr<QuicP2PSession> CreateP2PSession(scoped_ptr<Socket> socket, |
227 QuicP2PCryptoConfig crypto_config, | 227 QuicP2PCryptoConfig crypto_config, |
228 Perspective perspective) { | 228 Perspective perspective) { |
229 QuicChromiumPacketWriter* writer = | 229 QuicChromiumPacketWriter* writer = |
230 new QuicChromiumPacketWriter(socket.get()); | 230 new QuicChromiumPacketWriter(socket.get()); |
231 scoped_ptr<QuicConnection> quic_connection1(new QuicConnection( | 231 scoped_ptr<QuicConnection> quic_connection1(new QuicConnection( |
232 0, IPEndPoint(IPAddress(0, 0, 0, 0), 0), &quic_helper_, writer, | 232 0, IPEndPoint(IPAddress::IPv4AllZeros(), 0), &quic_helper_, writer, |
233 true /* owns_writer */, perspective, QuicSupportedVersions())); | 233 true /* owns_writer */, perspective, QuicSupportedVersions())); |
234 writer->SetConnection(quic_connection1.get()); | 234 writer->SetConnection(quic_connection1.get()); |
235 | 235 |
236 scoped_ptr<QuicP2PSession> result( | 236 scoped_ptr<QuicP2PSession> result( |
237 new QuicP2PSession(config_, crypto_config, std::move(quic_connection1), | 237 new QuicP2PSession(config_, crypto_config, std::move(quic_connection1), |
238 std::move(socket))); | 238 std::move(socket))); |
239 result->Initialize(); | 239 result->Initialize(); |
240 return result; | 240 return result; |
241 } | 241 } |
242 | 242 |
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
389 EXPECT_TRUE(stream_delegate.is_closed()); | 389 EXPECT_TRUE(stream_delegate.is_closed()); |
390 EXPECT_EQ(QUIC_PACKET_READ_ERROR, stream_delegate.error()); | 390 EXPECT_EQ(QUIC_PACKET_READ_ERROR, stream_delegate.error()); |
391 EXPECT_TRUE(session_delegate.is_closed()); | 391 EXPECT_TRUE(session_delegate.is_closed()); |
392 EXPECT_EQ(QUIC_PACKET_READ_ERROR, session_delegate.error()); | 392 EXPECT_EQ(QUIC_PACKET_READ_ERROR, session_delegate.error()); |
393 | 393 |
394 // Verify that the socket was destroyed. | 394 // Verify that the socket was destroyed. |
395 EXPECT_FALSE(socket1_); | 395 EXPECT_FALSE(socket1_); |
396 } | 396 } |
397 | 397 |
398 } // namespace net | 398 } // namespace net |
OLD | NEW |