diff options
Diffstat (limited to 'update_manager/update_manager-inl.h')
-rw-r--r-- | update_manager/update_manager-inl.h | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/update_manager/update_manager-inl.h b/update_manager/update_manager-inl.h index e9dee3f2..045ecffa 100644 --- a/update_manager/update_manager-inl.h +++ b/update_manager/update_manager-inl.h @@ -49,7 +49,6 @@ EvalStatus UpdateManager::EvaluatePolicy( ec->ResetEvaluation(); const std::string policy_name = policy_->PolicyRequestName(policy_method); - LOG(INFO) << policy_name << ": START"; // First try calling the actual policy. std::string error; @@ -71,14 +70,12 @@ EvalStatus UpdateManager::EvaluatePolicy( } } - LOG(INFO) << policy_name << ": END"; - return status; } template <typename R, typename... Args> void UpdateManager::OnPolicyReadyToEvaluate( - scoped_refptr<EvaluationContext> ec, + std::shared_ptr<EvaluationContext> ec, base::Callback<void(EvalStatus status, const R& result)> callback, EvalStatus (Policy::*policy_method)( EvaluationContext*, State*, std::string*, R*, Args...) const, @@ -119,8 +116,7 @@ EvalStatus UpdateManager::PolicyRequest( EvaluationContext*, State*, std::string*, R*, ExpectedArgs...) const, R* result, ActualArgs... args) { - scoped_refptr<EvaluationContext> ec( - new EvaluationContext(clock_, evaluation_timeout_)); + auto ec = std::make_shared<EvaluationContext>(evaluation_timeout_); // A PolicyRequest always consists on a single evaluation on a new // EvaluationContext. // IMPORTANT: To ensure that ActualArgs can be converted to ExpectedArgs, we @@ -141,15 +137,14 @@ void UpdateManager::AsyncPolicyRequest( EvalStatus (Policy::*policy_method)( EvaluationContext*, State*, std::string*, R*, ExpectedArgs...) const, ActualArgs... args) { - scoped_refptr<EvaluationContext> ec = new EvaluationContext( - clock_, + auto ec = std::make_shared<EvaluationContext>( evaluation_timeout_, expiration_timeout_, std::unique_ptr<base::Callback<void(EvaluationContext*)>>( new base::Callback<void(EvaluationContext*)>( base::Bind(&UpdateManager::UnregisterEvalContext, weak_ptr_factory_.GetWeakPtr())))); - if (!ec_repo_.insert(ec.get()).second) { + if (!ec_repo_.insert(ec).second) { LOG(ERROR) << "Failed to register evaluation context; this is a bug."; } |