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

Unified Diff: net/dns/dns_session.cc

Issue 1545233002: Convert Pass()→std::move() in //net (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/dns/dns_client.cc ('k') | net/dns/dns_session_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/dns/dns_session.cc
diff --git a/net/dns/dns_session.cc b/net/dns/dns_session.cc
index b200ea3cf6ac3e51ace56d857b10241586fa66ad..5148e0b878b2eba15c598f0673f29b9b699341f2 100644
--- a/net/dns/dns_session.cc
+++ b/net/dns/dns_session.cc
@@ -5,8 +5,8 @@
#include "net/dns/dns_session.h"
#include <stdint.h>
-
#include <limits>
+#include <utility>
#include "base/bind.h"
#include "base/lazy_instance.h"
@@ -78,10 +78,12 @@ DnsSession::RttBuckets::RttBuckets() : base::BucketRanges(kRTTBucketCount + 1) {
DnsSession::SocketLease::SocketLease(scoped_refptr<DnsSession> session,
unsigned server_index,
scoped_ptr<DatagramClientSocket> socket)
- : session_(session), server_index_(server_index), socket_(socket.Pass()) {}
+ : session_(session),
+ server_index_(server_index),
+ socket_(std::move(socket)) {}
DnsSession::SocketLease::~SocketLease() {
- session_->FreeSocket(server_index_, socket_.Pass());
+ session_->FreeSocket(server_index_, std::move(socket_));
}
DnsSession::DnsSession(const DnsConfig& config,
@@ -89,7 +91,7 @@ DnsSession::DnsSession(const DnsConfig& config,
const RandIntCallback& rand_int_callback,
NetLog* net_log)
: config_(config),
- socket_pool_(socket_pool.Pass()),
+ socket_pool_(std::move(socket_pool)),
rand_callback_(base::Bind(rand_int_callback,
0,
std::numeric_limits<uint16_t>::max())),
@@ -239,7 +241,7 @@ scoped_ptr<DnsSession::SocketLease> DnsSession::AllocateSocket(
socket->NetLog().BeginEvent(NetLog::TYPE_SOCKET_IN_USE,
source.ToEventParametersCallback());
- SocketLease* lease = new SocketLease(this, server_index, socket.Pass());
+ SocketLease* lease = new SocketLease(this, server_index, std::move(socket));
return scoped_ptr<SocketLease>(lease);
}
@@ -255,7 +257,7 @@ void DnsSession::FreeSocket(unsigned server_index,
socket->NetLog().EndEvent(NetLog::TYPE_SOCKET_IN_USE);
- socket_pool_->FreeSocket(server_index, socket.Pass());
+ socket_pool_->FreeSocket(server_index, std::move(socket));
}
base::TimeDelta DnsSession::NextTimeoutFromJacobson(unsigned server_index,
« no previous file with comments | « net/dns/dns_client.cc ('k') | net/dns/dns_session_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698