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

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

Issue 1893083002: Change scoped_ptr to std::unique_ptr in //net. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: scopedptr-net-all: iwyu Created 4 years, 8 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
« no previous file with comments | « net/tools/quic/quic_simple_client.h ('k') | net/tools/quic/quic_simple_client_bin.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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
OLDNEW
« no previous file with comments | « net/tools/quic/quic_simple_client.h ('k') | net/tools/quic/quic_simple_client_bin.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698