Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4754)

Unified Diff: chrome/installer/util/work_item.cc

Issue 1976443005: Revert of Add best-effort/allow rollback flags on WorkItem. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@simple_list_tests
Patch Set: Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/installer/util/work_item.h ('k') | chrome/installer/util/work_item_list.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/installer/util/work_item.cc
diff --git a/chrome/installer/util/work_item.cc b/chrome/installer/util/work_item.cc
index 988a4711f516983b8b6fb849d10c7a8f007d01f3..e38413d94ef34df56a274cf864eab751493fbb96 100644
--- a/chrome/installer/util/work_item.cc
+++ b/chrome/installer/util/work_item.cc
@@ -6,7 +6,6 @@
#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"
@@ -20,8 +19,11 @@
#include "chrome/installer/util/set_reg_value_work_item.h"
#include "chrome/installer/util/work_item_list.h"
-WorkItem::WorkItem() = default;
-WorkItem::~WorkItem() = default;
+WorkItem::WorkItem() : ignore_failure_(false) {
+}
+
+WorkItem::~WorkItem() {
+}
CallbackWorkItem* WorkItem::CreateCallbackWorkItem(
base::Callback<bool(const CallbackWorkItem&)> callback) {
@@ -68,8 +70,9 @@
DeleteTreeWorkItem* WorkItem::CreateDeleteTreeWorkItem(
const base::FilePath& root_path,
- const base::FilePath& temp_path) {
- return new DeleteTreeWorkItem(root_path, temp_path);
+ const base::FilePath& temp_path,
+ const std::vector<base::FilePath>& key_paths) {
+ return new DeleteTreeWorkItem(root_path, temp_path, key_paths);
}
MoveTreeWorkItem* WorkItem::CreateMoveTreeWorkItem(
@@ -151,30 +154,11 @@
return new WorkItemList();
}
+// static
+WorkItemList* WorkItem::CreateNoRollbackWorkItemList() {
+ return new NoRollbackWorkItemList();
+}
+
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;
-}
« no previous file with comments | « chrome/installer/util/work_item.h ('k') | chrome/installer/util/work_item_list.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698