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 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
93 bool fin) | 93 bool fin) |
94 : headers_(headers), body_(body), fin_(fin) {} | 94 : headers_(headers), body_(body), fin_(fin) {} |
95 | 95 |
96 QuicSimpleClient::QuicDataToResend::~QuicDataToResend() { | 96 QuicSimpleClient::QuicDataToResend::~QuicDataToResend() { |
97 if (headers_) { | 97 if (headers_) { |
98 delete headers_; | 98 delete headers_; |
99 } | 99 } |
100 } | 100 } |
101 | 101 |
102 bool QuicSimpleClient::CreateUDPSocket() { | 102 bool QuicSimpleClient::CreateUDPSocket() { |
103 scoped_ptr<UDPClientSocket> socket( | 103 std::unique_ptr<UDPClientSocket> socket( |
104 new UDPClientSocket(DatagramSocket::DEFAULT_BIND, RandIntCallback(), | 104 new UDPClientSocket(DatagramSocket::DEFAULT_BIND, RandIntCallback(), |
105 &net_log_, NetLog::Source())); | 105 &net_log_, NetLog::Source())); |
106 | 106 |
107 int address_family = server_address_.GetSockAddrFamily(); | 107 int address_family = server_address_.GetSockAddrFamily(); |
108 if (bind_to_address_.size() != 0) { | 108 if (bind_to_address_.size() != 0) { |
109 client_address_ = IPEndPoint(bind_to_address_, local_port_); | 109 client_address_ = IPEndPoint(bind_to_address_, local_port_); |
110 } else if (address_family == AF_INET) { | 110 } else if (address_family == AF_INET) { |
111 client_address_ = IPEndPoint(IPAddress::IPv4AllZeros(), local_port_); | 111 client_address_ = IPEndPoint(IPAddress::IPv4AllZeros(), local_port_); |
112 } else { | 112 } else { |
113 client_address_ = IPEndPoint(IPAddress::IPv6AllZeros(), local_port_); | 113 client_address_ = IPEndPoint(IPAddress::IPv6AllZeros(), local_port_); |
(...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
397 session()->connection()->ProcessUdpPacket(local_address, peer_address, | 397 session()->connection()->ProcessUdpPacket(local_address, peer_address, |
398 packet); | 398 packet); |
399 if (!session()->connection()->connected()) { | 399 if (!session()->connection()->connected()) { |
400 return false; | 400 return false; |
401 } | 401 } |
402 | 402 |
403 return true; | 403 return true; |
404 } | 404 } |
405 | 405 |
406 } // namespace net | 406 } // namespace net |
OLD | NEW |