Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(71)

Side by Side Diff: net/tools/quic/quic_simple_client.cc

Issue 1543903002: Adds socket param to OnReadError in QuicPacketReader's Visitor interface. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@home
Patch Set: Created 4 years, 12 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
OLDNEW
« net/quic/quic_chromium_client_session.cc ('K') | « net/tools/quic/quic_simple_client.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698