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

Unified Diff: net/dns/dns_transaction.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_socket_pool.cc ('k') | net/dns/dns_transaction_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/dns/dns_transaction.cc
diff --git a/net/dns/dns_transaction.cc b/net/dns/dns_transaction.cc
index 52d54706eea370777c59dfeaf33a52b20cf70f96..8eebb8c69f203152bd3f1ba450b54f92bc6d590f 100644
--- a/net/dns/dns_transaction.cc
+++ b/net/dns/dns_transaction.cc
@@ -6,6 +6,7 @@
#include <deque>
#include <string>
+#include <utility>
#include <vector>
#include "base/big_endian.h"
@@ -67,7 +68,7 @@ scoped_ptr<base::Value> NetLogStartCallback(
scoped_ptr<base::DictionaryValue> dict(new base::DictionaryValue());
dict->SetString("hostname", *hostname);
dict->SetInteger("query_type", qtype);
- return dict.Pass();
+ return std::move(dict);
};
// ----------------------------------------------------------------------------
@@ -109,7 +110,7 @@ class DnsAttempt {
dict->SetInteger("rcode", GetResponse()->rcode());
dict->SetInteger("answer_count", GetResponse()->answer_count());
GetSocketNetLog().source().AddToEventParameters(dict.get());
- return dict.Pass();
+ return std::move(dict);
}
void set_result(int result) {
@@ -142,8 +143,8 @@ class DnsUDPAttempt : public DnsAttempt {
: DnsAttempt(server_index),
next_state_(STATE_NONE),
received_malformed_response_(false),
- socket_lease_(socket_lease.Pass()),
- query_(query.Pass()) {}
+ socket_lease_(std::move(socket_lease)),
+ query_(std::move(query)) {}
// DnsAttempt:
int Start(const CompletionCallback& callback) override {
@@ -303,8 +304,8 @@ class DnsTCPAttempt : public DnsAttempt {
scoped_ptr<DnsQuery> query)
: DnsAttempt(server_index),
next_state_(STATE_NONE),
- socket_(socket.Pass()),
- query_(query.Pass()),
+ socket_(std::move(socket)),
+ query_(std::move(query)),
length_buffer_(new IOBufferWithSize(sizeof(uint16_t))),
response_length_(0) {}
@@ -724,7 +725,7 @@ class DnsTransactionImpl : public DnsTransaction,
bool got_socket = !!lease.get();
DnsUDPAttempt* attempt =
- new DnsUDPAttempt(server_index, lease.Pass(), query.Pass());
+ new DnsUDPAttempt(server_index, std::move(lease), std::move(query));
attempts_.push_back(make_scoped_ptr(attempt));
++attempts_count_;
@@ -768,8 +769,8 @@ class DnsTransactionImpl : public DnsTransaction,
unsigned attempt_number = attempts_.size();
- DnsTCPAttempt* attempt = new DnsTCPAttempt(server_index, socket.Pass(),
- query.Pass());
+ DnsTCPAttempt* attempt =
+ new DnsTCPAttempt(server_index, std::move(socket), std::move(query));
attempts_.push_back(make_scoped_ptr(attempt));
++attempts_count_;
« no previous file with comments | « net/dns/dns_socket_pool.cc ('k') | net/dns/dns_transaction_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698