| Index: chrome/installer/util/work_item.cc
|
| diff --git a/chrome/installer/util/work_item.cc b/chrome/installer/util/work_item.cc
|
| index e38413d94ef34df56a274cf864eab751493fbb96..9c929b7ef1a4eee7707e446e567d640cb08d09c2 100644
|
| --- a/chrome/installer/util/work_item.cc
|
| +++ b/chrome/installer/util/work_item.cc
|
| @@ -6,6 +6,7 @@
|
|
|
| #include <windows.h>
|
|
|
| +#include "base/logging.h"
|
| #include "chrome/installer/util/callback_work_item.h"
|
| #include "chrome/installer/util/conditional_work_item_list.h"
|
| #include "chrome/installer/util/copy_tree_work_item.h"
|
| @@ -19,11 +20,8 @@
|
| #include "chrome/installer/util/set_reg_value_work_item.h"
|
| #include "chrome/installer/util/work_item_list.h"
|
|
|
| -WorkItem::WorkItem() : ignore_failure_(false) {
|
| -}
|
| -
|
| -WorkItem::~WorkItem() {
|
| -}
|
| +WorkItem::WorkItem() = default;
|
| +WorkItem::~WorkItem() = default;
|
|
|
| CallbackWorkItem* WorkItem::CreateCallbackWorkItem(
|
| base::Callback<bool(const CallbackWorkItem&)> callback) {
|
| @@ -162,3 +160,27 @@ WorkItemList* WorkItem::CreateNoRollbackWorkItemList() {
|
| WorkItemList* WorkItem::CreateConditionalWorkItemList(Condition* condition) {
|
| return new ConditionalWorkItemList(condition);
|
| }
|
| +
|
| +bool WorkItem::Do() {
|
| + DCHECK_EQ(BEFORE_DO, state_);
|
| + const bool success = DoImpl();
|
| + state_ = AFTER_DO;
|
| + return best_effort() ? true : success;
|
| +}
|
| +
|
| +void WorkItem::Rollback() {
|
| + DCHECK_EQ(AFTER_DO, state_);
|
| + if (rollback_enabled())
|
| + RollbackImpl();
|
| + state_ = AFTER_ROLLBACK;
|
| +}
|
| +
|
| +void WorkItem::set_best_effort(bool best_effort) {
|
| + DCHECK_EQ(BEFORE_DO, state());
|
| + best_effort_ = best_effort;
|
| +}
|
| +
|
| +void WorkItem::set_rollback_enabled(bool rollback_enabled) {
|
| + DCHECK_EQ(BEFORE_DO, state());
|
| + rollback_enabled_ = rollback_enabled;
|
| +}
|
|
|