| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/installer/util/work_item_list.h" | 5 #include "chrome/installer/util/work_item_list.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/file_path.h" | 8 #include "base/file_path.h" |
| 9 #include "chrome/installer/util/logging_installer.h" | 9 #include "chrome/installer/util/logging_installer.h" |
| 10 #include "chrome/installer/util/copy_tree_work_item.h" | 10 #include "chrome/installer/util/copy_tree_work_item.h" |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 112 const std::wstring& key_path, | 112 const std::wstring& key_path, |
| 113 const std::wstring& value_name) { | 113 const std::wstring& value_name) { |
| 114 WorkItem* item = WorkItem::CreateDeleteRegValueWorkItem(predefined_root, | 114 WorkItem* item = WorkItem::CreateDeleteRegValueWorkItem(predefined_root, |
| 115 key_path, value_name); | 115 key_path, value_name); |
| 116 AddWorkItem(item); | 116 AddWorkItem(item); |
| 117 return item; | 117 return item; |
| 118 } | 118 } |
| 119 | 119 |
| 120 WorkItem* WorkItemList::AddDeleteTreeWorkItem( | 120 WorkItem* WorkItemList::AddDeleteTreeWorkItem( |
| 121 const FilePath& root_path, | 121 const FilePath& root_path, |
| 122 const FilePath& temp_path, |
| 122 const std::vector<FilePath>& key_paths) { | 123 const std::vector<FilePath>& key_paths) { |
| 123 WorkItem* item = WorkItem::CreateDeleteTreeWorkItem(root_path, key_paths); | 124 WorkItem* item = WorkItem::CreateDeleteTreeWorkItem(root_path, temp_path, |
| 125 key_paths); |
| 124 AddWorkItem(item); | 126 AddWorkItem(item); |
| 125 return item; | 127 return item; |
| 126 } | 128 } |
| 127 | 129 |
| 128 WorkItem* WorkItemList::AddDeleteTreeWorkItem(const FilePath& root_path) { | 130 WorkItem* WorkItemList::AddDeleteTreeWorkItem(const FilePath& root_path, |
| 131 const FilePath& temp_path) { |
| 129 std::vector<FilePath> no_key_files; | 132 std::vector<FilePath> no_key_files; |
| 130 return AddDeleteTreeWorkItem(root_path, no_key_files); | 133 return AddDeleteTreeWorkItem(root_path, temp_path, no_key_files); |
| 131 } | 134 } |
| 132 | 135 |
| 133 WorkItem* WorkItemList::AddMoveTreeWorkItem(const std::wstring& source_path, | 136 WorkItem* WorkItemList::AddMoveTreeWorkItem(const std::wstring& source_path, |
| 134 const std::wstring& dest_path, | 137 const std::wstring& dest_path, |
| 135 const std::wstring& temp_dir) { | 138 const std::wstring& temp_dir) { |
| 136 WorkItem* item = WorkItem::CreateMoveTreeWorkItem(FilePath(source_path), | 139 WorkItem* item = WorkItem::CreateMoveTreeWorkItem(FilePath(source_path), |
| 137 FilePath(dest_path), | 140 FilePath(dest_path), |
| 138 FilePath(temp_dir)); | 141 FilePath(temp_dir)); |
| 139 AddWorkItem(item); | 142 AddWorkItem(item); |
| 140 return item; | 143 return item; |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 214 VLOG(1) << "NoRollbackWorkItemList: list execution succeeded"; | 217 VLOG(1) << "NoRollbackWorkItemList: list execution succeeded"; |
| 215 | 218 |
| 216 status_ = LIST_EXECUTED; | 219 status_ = LIST_EXECUTED; |
| 217 return result; | 220 return result; |
| 218 } | 221 } |
| 219 | 222 |
| 220 void NoRollbackWorkItemList::Rollback() { | 223 void NoRollbackWorkItemList::Rollback() { |
| 221 NOTREACHED() << "Can't rollback a NoRollbackWorkItemList"; | 224 NOTREACHED() << "Can't rollback a NoRollbackWorkItemList"; |
| 222 } | 225 } |
| 223 | 226 |
| OLD | NEW |