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/update_manager/evaluation_context.h b/update_manager/evaluation_context.h
index a6d8f70..e7fba00 100644
--- a/update_manager/evaluation_context.h
+++ b/update_manager/evaluation_context.h
@@ -6,12 +6,12 @@
#define UPDATE_ENGINE_UPDATE_MANAGER_EVALUATION_CONTEXT_H_
#include <map>
+#include <memory>
#include <string>
#include <base/bind.h>
#include <base/callback.h>
#include <base/memory/ref_counted.h>
-#include <base/memory/scoped_ptr.h>
#include <base/memory/weak_ptr.h>
#include <base/time/time.h>
@@ -57,12 +57,12 @@
chromeos_update_engine::ClockInterface* clock,
base::TimeDelta evaluation_timeout,
base::TimeDelta expiration_timeout,
- scoped_ptr<base::Callback<void(EvaluationContext*)>> unregister_cb);
+ std::unique_ptr<base::Callback<void(EvaluationContext*)>> unregister_cb);
EvaluationContext(chromeos_update_engine::ClockInterface* clock,
base::TimeDelta evaluation_timeout)
: EvaluationContext(
clock, evaluation_timeout, base::TimeDelta::Max(),
- scoped_ptr<base::Callback<void(EvaluationContext*)>>()) {}
+ std::unique_ptr<base::Callback<void(EvaluationContext*)>>()) {}
~EvaluationContext();
// Returns a pointer to the value returned by the passed variable |var|. The
@@ -113,7 +113,7 @@
// Removes all the Observers callbacks and timeout events scheduled by
// RunOnValueChangeOrTimeout(). Also releases and returns the closure
// associated with these events. This method is idempotent.
- scoped_ptr<base::Closure> RemoveObserversAndTimeout();
+ std::unique_ptr<base::Closure> RemoveObserversAndTimeout();
private:
friend class UmEvaluationContextTest;
@@ -147,7 +147,7 @@
// timeout, or notifying about the evaluation context expiration. It is up to
// the caller to determine whether or not expiration occurred via
// is_expired().
- scoped_ptr<base::Closure> callback_;
+ std::unique_ptr<base::Closure> callback_;
// The EventId returned by the event loop identifying the timeout callback.
// Used for canceling the timeout callback.
@@ -193,7 +193,7 @@
base::Time expiration_monotonic_deadline_;
// A callback for unregistering the context upon destruction.
- scoped_ptr<base::Callback<void(EvaluationContext*)>> unregister_cb_;
+ std::unique_ptr<base::Callback<void(EvaluationContext*)>> unregister_cb_;
base::WeakPtrFactory<EvaluationContext> weak_ptr_factory_;