update_engine: Replace scoped_ptr with std::unique_ptr.
BUG=None
TEST=`FEATURES=test emerge-$BOARD update_engine`
TEST=`USE='clang asan' FEATURES=test emerge-$BOARD update_engine`
Change-Id: I55a2f7f53675faaac20ba25f72ed52cf938d7744
Reviewed-on: https://chromium-review.googlesource.com/224189
Tested-by: Ben Chan <benchan@chromium.org>
Reviewed-by: Alex Deymo <deymo@chromium.org>
Commit-Queue: Ben Chan <benchan@chromium.org>
diff --git a/p2p_manager.cc b/p2p_manager.cc
index 2ec827a..b1383e2 100644
--- a/p2p_manager.cc
+++ b/p2p_manager.cc
@@ -25,6 +25,7 @@
#include <algorithm>
#include <map>
+#include <memory>
#include <utility>
#include <vector>
@@ -42,6 +43,7 @@
using std::map;
using std::pair;
using std::string;
+using std::unique_ptr;
using std::vector;
namespace chromeos_update_engine {
@@ -139,7 +141,7 @@
const policy::DevicePolicy* device_policy_;
// Configuration object.
- scoped_ptr<Configuration> configuration_;
+ unique_ptr<Configuration> configuration_;
// Object for persisted state.
PrefsInterface* prefs_;
@@ -235,7 +237,7 @@
gint exit_status = 0;
vector<string> args = configuration_->GetInitctlArgs(should_be_running);
- scoped_ptr<gchar*, GLibStrvFreeDeleter> argv(
+ unique_ptr<gchar*, GLibStrvFreeDeleter> argv(
utils::StringVectorToGStrv(args));
if (!g_spawn_sync(nullptr, // working_directory
argv.get(),
@@ -250,7 +252,7 @@
<< ": " << utils::GetAndFreeGError(&error);
return false;
}
- scoped_ptr<gchar, GLibFreeDeleter> standard_error_deleter(standard_error);
+ unique_ptr<gchar, GLibFreeDeleter> standard_error_deleter(standard_error);
if (!WIFEXITED(exit_status)) {
LOG(ERROR) << "Error spawning '" << utils::StringVectorToString(args)