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/tools/quic/quic_simple_client.h" | 5 #include "net/tools/quic/quic_simple_client.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/run_loop.h" | 8 #include "base/run_loop.h" |
9 #include "base/thread_task_runner_handle.h" | 9 #include "base/thread_task_runner_handle.h" |
10 #include "net/base/net_errors.h" | 10 #include "net/base/net_errors.h" |
(...skipping 367 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
378 | 378 |
379 QuicConnectionHelper* QuicSimpleClient::CreateQuicConnectionHelper() { | 379 QuicConnectionHelper* QuicSimpleClient::CreateQuicConnectionHelper() { |
380 return new QuicConnectionHelper(base::ThreadTaskRunnerHandle::Get().get(), | 380 return new QuicConnectionHelper(base::ThreadTaskRunnerHandle::Get().get(), |
381 &clock_, QuicRandom::GetInstance()); | 381 &clock_, QuicRandom::GetInstance()); |
382 } | 382 } |
383 | 383 |
384 QuicPacketWriter* QuicSimpleClient::CreateQuicPacketWriter() { | 384 QuicPacketWriter* QuicSimpleClient::CreateQuicPacketWriter() { |
385 return new QuicDefaultPacketWriter(socket_.get()); | 385 return new QuicDefaultPacketWriter(socket_.get()); |
386 } | 386 } |
387 | 387 |
388 void QuicSimpleClient::OnReadError(int result) { | 388 void QuicSimpleClient::OnReadError(int result, |
| 389 const DatagramClientSocket* socket) { |
389 LOG(ERROR) << "QuicSimpleClient read failed: " << ErrorToShortString(result); | 390 LOG(ERROR) << "QuicSimpleClient read failed: " << ErrorToShortString(result); |
390 Disconnect(); | 391 Disconnect(); |
391 } | 392 } |
392 | 393 |
393 bool QuicSimpleClient::OnPacket(const QuicEncryptedPacket& packet, | 394 bool QuicSimpleClient::OnPacket(const QuicEncryptedPacket& packet, |
394 IPEndPoint local_address, | 395 IPEndPoint local_address, |
395 IPEndPoint peer_address) { | 396 IPEndPoint peer_address) { |
396 session()->connection()->ProcessUdpPacket(local_address, peer_address, | 397 session()->connection()->ProcessUdpPacket(local_address, peer_address, |
397 packet); | 398 packet); |
398 if (!session()->connection()->connected()) { | 399 if (!session()->connection()->connected()) { |
399 return false; | 400 return false; |
400 } | 401 } |
401 | 402 |
402 return true; | 403 return true; |
403 } | 404 } |
404 | 405 |
405 } // namespace tools | 406 } // namespace tools |
406 } // namespace net | 407 } // namespace net |
OLD | NEW |