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

Unified Diff: tools/battor_agent/battor_connection_impl.cc

Issue 2254873004: Re-write many calls to WrapUnique() with MakeUnique() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | tools/battor_agent/battor_connection_impl_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/battor_agent/battor_connection_impl.cc
diff --git a/tools/battor_agent/battor_connection_impl.cc b/tools/battor_agent/battor_connection_impl.cc
index 849637bf8dde71fedc214c68684084137b17aa9c..0677ea08155a6b1cb9b824e91479bcb4c80aaf34 100644
--- a/tools/battor_agent/battor_connection_impl.cc
+++ b/tools/battor_agent/battor_connection_impl.cc
@@ -143,8 +143,8 @@ void BattOrConnectionImpl::SendBytes(BattOrMessageType type,
LogSerial(StringPrintf("Bytes sent: %s.", CharVectorToString(data).c_str()));
pending_write_length_ = data.size();
- io_handler_->Write(base::WrapUnique(new device::SendBuffer(
- data, base::Bind(&BattOrConnectionImpl::OnBytesSent, AsWeakPtr()))));
+ io_handler_->Write(base::MakeUnique<device::SendBuffer>(
+ data, base::Bind(&BattOrConnectionImpl::OnBytesSent, AsWeakPtr())));
}
void BattOrConnectionImpl::ReadMessage(BattOrMessageType type) {
@@ -205,9 +205,9 @@ void BattOrConnectionImpl::BeginReadBytes(size_t max_bytes_to_read) {
auto on_receive_buffer_filled =
base::Bind(&BattOrConnectionImpl::OnBytesRead, AsWeakPtr());
- io_handler_->Read(base::WrapUnique(new device::ReceiveBuffer(
+ io_handler_->Read(base::MakeUnique<device::ReceiveBuffer>(
pending_read_buffer_, static_cast<uint32_t>(max_bytes_to_read),
- on_receive_buffer_filled)));
+ on_receive_buffer_filled));
}
void BattOrConnectionImpl::OnBytesRead(int bytes_read,
« no previous file with comments | « no previous file | tools/battor_agent/battor_connection_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698