adb: implement std::make_unique, start using it.
Add an implementation of std::make_unique for Windows, where we're
currently stuck with C++11, and switch some uses of new over to it.
Bug: http://b/74616284
Test: treehugger
Change-Id: I99b85f07754adda7c525243480c3e0bce9a25ce7
(cherry picked from commit 31b5be69f4f39365ce0faad85faba604a2509022)
diff --git a/adb/shell_service.cpp b/adb/shell_service.cpp
index f9f80c0..c04ceaf 100644
--- a/adb/shell_service.cpp
+++ b/adb/shell_service.cpp
@@ -372,8 +372,8 @@
}
D("protocol FD = %d", protocol_sfd_.get());
- input_.reset(new ShellProtocol(protocol_sfd_));
- output_.reset(new ShellProtocol(protocol_sfd_));
+ input_ = std::make_unique<ShellProtocol>(protocol_sfd_);
+ output_ = std::make_unique<ShellProtocol>(protocol_sfd_);
if (!input_ || !output_) {
*error = "failed to allocate shell protocol objects";
kill(pid_, SIGKILL);