| 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_reg_key_work_item.h" |
| 10 #include "chrome/installer/util/copy_tree_work_item.h" | 11 #include "chrome/installer/util/copy_tree_work_item.h" |
| 11 #include "chrome/installer/util/create_dir_work_item.h" | 12 #include "chrome/installer/util/create_dir_work_item.h" |
| 12 #include "chrome/installer/util/create_reg_key_work_item.h" | 13 #include "chrome/installer/util/create_reg_key_work_item.h" |
| 13 #include "chrome/installer/util/delete_tree_work_item.h" | 14 #include "chrome/installer/util/delete_tree_work_item.h" |
| 14 #include "chrome/installer/util/delete_reg_key_work_item.h" | 15 #include "chrome/installer/util/delete_reg_key_work_item.h" |
| 15 #include "chrome/installer/util/delete_reg_value_work_item.h" | 16 #include "chrome/installer/util/delete_reg_value_work_item.h" |
| 16 #include "chrome/installer/util/move_tree_work_item.h" | 17 #include "chrome/installer/util/move_tree_work_item.h" |
| 17 #include "chrome/installer/util/self_reg_work_item.h" | 18 #include "chrome/installer/util/self_reg_work_item.h" |
| 18 #include "chrome/installer/util/set_reg_value_work_item.h" | 19 #include "chrome/installer/util/set_reg_value_work_item.h" |
| 19 | 20 |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 65 | 66 |
| 66 status_ = LIST_ROLLED_BACK; | 67 status_ = LIST_ROLLED_BACK; |
| 67 return; | 68 return; |
| 68 } | 69 } |
| 69 | 70 |
| 70 void WorkItemList::AddWorkItem(WorkItem* work_item) { | 71 void WorkItemList::AddWorkItem(WorkItem* work_item) { |
| 71 DCHECK(status_ == ADD_ITEM); | 72 DCHECK(status_ == ADD_ITEM); |
| 72 list_.push_back(work_item); | 73 list_.push_back(work_item); |
| 73 } | 74 } |
| 74 | 75 |
| 76 WorkItem* WorkItemList::AddCopyRegKeyWorkItem( |
| 77 HKEY predefined_root, |
| 78 const std::wstring& source_key_path, |
| 79 const std::wstring& dest_key_path) { |
| 80 WorkItem* item = WorkItem::CreateCopyRegKeyWorkItem( |
| 81 predefined_root, source_key_path, dest_key_path); |
| 82 AddWorkItem(item); |
| 83 return item; |
| 84 } |
| 85 |
| 75 WorkItem* WorkItemList::AddCopyTreeWorkItem( | 86 WorkItem* WorkItemList::AddCopyTreeWorkItem( |
| 76 const std::wstring& source_path, | 87 const std::wstring& source_path, |
| 77 const std::wstring& dest_path, | 88 const std::wstring& dest_path, |
| 78 const std::wstring& temp_dir, | 89 const std::wstring& temp_dir, |
| 79 CopyOverWriteOption overwrite_option, | 90 CopyOverWriteOption overwrite_option, |
| 80 const std::wstring& alternative_path) { | 91 const std::wstring& alternative_path) { |
| 81 WorkItem* item = WorkItem::CreateCopyTreeWorkItem(FilePath(source_path), | 92 WorkItem* item = WorkItem::CreateCopyTreeWorkItem(FilePath(source_path), |
| 82 FilePath(dest_path), | 93 FilePath(dest_path), |
| 83 FilePath(temp_dir), | 94 FilePath(temp_dir), |
| 84 overwrite_option, | 95 overwrite_option, |
| (...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 219 if (result) | 230 if (result) |
| 220 VLOG(1) << "NoRollbackWorkItemList: list execution succeeded"; | 231 VLOG(1) << "NoRollbackWorkItemList: list execution succeeded"; |
| 221 | 232 |
| 222 status_ = LIST_EXECUTED; | 233 status_ = LIST_EXECUTED; |
| 223 return result; | 234 return result; |
| 224 } | 235 } |
| 225 | 236 |
| 226 void NoRollbackWorkItemList::Rollback() { | 237 void NoRollbackWorkItemList::Rollback() { |
| 227 NOTREACHED() << "Can't rollback a NoRollbackWorkItemList"; | 238 NOTREACHED() << "Can't rollback a NoRollbackWorkItemList"; |
| 228 } | 239 } |
| OLD | NEW |