| 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 #ifndef CHROME_INSTALLER_UTIL_WORK_ITEM_LIST_H_ | 5 #ifndef CHROME_INSTALLER_UTIL_WORK_ITEM_LIST_H_ |
| 6 #define CHROME_INSTALLER_UTIL_WORK_ITEM_LIST_H_ | 6 #define CHROME_INSTALLER_UTIL_WORK_ITEM_LIST_H_ |
| 7 | 7 |
| 8 #include <windows.h> | 8 #include <windows.h> |
| 9 | 9 |
| 10 #include <list> | 10 #include <list> |
| (...skipping 25 matching lines...) Expand all Loading... |
| 36 | 36 |
| 37 // Add a WorkItem to the list. | 37 // Add a WorkItem to the list. |
| 38 // A WorkItem can only be added to the list before the list's DO() is called. | 38 // A WorkItem can only be added to the list before the list's DO() is called. |
| 39 // Once a WorkItem is added to the list. The list owns the WorkItem. | 39 // Once a WorkItem is added to the list. The list owns the WorkItem. |
| 40 virtual void AddWorkItem(WorkItem* work_item); | 40 virtual void AddWorkItem(WorkItem* work_item); |
| 41 | 41 |
| 42 // Add a CallbackWorkItem that invokes a callback. | 42 // Add a CallbackWorkItem that invokes a callback. |
| 43 virtual WorkItem* AddCallbackWorkItem( | 43 virtual WorkItem* AddCallbackWorkItem( |
| 44 base::Callback<bool(const CallbackWorkItem&)> callback); | 44 base::Callback<bool(const CallbackWorkItem&)> callback); |
| 45 | 45 |
| 46 // Add a CopyRegKeyWorkItem that recursively copies a given registry key. | |
| 47 virtual WorkItem* AddCopyRegKeyWorkItem(HKEY predefined_root, | |
| 48 const std::wstring& source_key_path, | |
| 49 const std::wstring& dest_key_path, | |
| 50 CopyOverWriteOption overwrite_option); | |
| 51 | |
| 52 // Add a CopyTreeWorkItem to the list of work items. | 46 // Add a CopyTreeWorkItem to the list of work items. |
| 53 // See the NOTE in the documentation for the CopyTreeWorkItem class for | 47 // See the NOTE in the documentation for the CopyTreeWorkItem class for |
| 54 // special considerations regarding |temp_dir|. | 48 // special considerations regarding |temp_dir|. |
| 55 virtual WorkItem* AddCopyTreeWorkItem( | 49 virtual WorkItem* AddCopyTreeWorkItem( |
| 56 const std::wstring& source_path, | 50 const std::wstring& source_path, |
| 57 const std::wstring& dest_path, | 51 const std::wstring& dest_path, |
| 58 const std::wstring& temp_dir, | 52 const std::wstring& temp_dir, |
| 59 CopyOverWriteOption overwrite_option, | 53 CopyOverWriteOption overwrite_option, |
| 60 const std::wstring& alternative_path = L""); | 54 const std::wstring& alternative_path = L""); |
| 61 | 55 |
| 62 // Add a CreateDirWorkItem that creates a directory at the given path. | 56 // Add a CreateDirWorkItem that creates a directory at the given path. |
| 63 virtual WorkItem* AddCreateDirWorkItem(const base::FilePath& path); | 57 virtual WorkItem* AddCreateDirWorkItem(const base::FilePath& path); |
| 64 | 58 |
| 65 // Add a CreateRegKeyWorkItem that creates a registry key at the given | 59 // Add a CreateRegKeyWorkItem that creates a registry key at the given |
| 66 // path. | 60 // path. |
| 67 virtual WorkItem* AddCreateRegKeyWorkItem(HKEY predefined_root, | 61 virtual WorkItem* AddCreateRegKeyWorkItem(HKEY predefined_root, |
| 68 const std::wstring& path); | 62 const std::wstring& path, |
| 63 REGSAM wow64_access); |
| 69 | 64 |
| 70 // Add a DeleteRegKeyWorkItem that deletes a registry key from the given | 65 // Add a DeleteRegKeyWorkItem that deletes a registry key from the given |
| 71 // path. | 66 // path. |
| 72 virtual WorkItem* AddDeleteRegKeyWorkItem(HKEY predefined_root, | 67 virtual WorkItem* AddDeleteRegKeyWorkItem(HKEY predefined_root, |
| 73 const std::wstring& path); | 68 const std::wstring& path, |
| 69 REGSAM wow64_access); |
| 74 | 70 |
| 75 // Add a DeleteRegValueWorkItem that deletes registry value of type REG_SZ | 71 // Add a DeleteRegValueWorkItem that deletes registry value of type REG_SZ |
| 76 // or REG_DWORD. | 72 // or REG_DWORD. |
| 77 virtual WorkItem* AddDeleteRegValueWorkItem(HKEY predefined_root, | 73 virtual WorkItem* AddDeleteRegValueWorkItem(HKEY predefined_root, |
| 78 const std::wstring& key_path, | 74 const std::wstring& key_path, |
| 79 const std::wstring& value_name); | 75 const std::wstring& value_name, |
| 76 REGSAM wow64_access); |
| 80 | 77 |
| 81 // Add a DeleteTreeWorkItem that recursively deletes a file system | 78 // Add a DeleteTreeWorkItem that recursively deletes a file system |
| 82 // hierarchy at the given root path. A key file can be optionally specified | 79 // hierarchy at the given root path. A key file can be optionally specified |
| 83 // by key_path. | 80 // by key_path. |
| 84 virtual WorkItem* AddDeleteTreeWorkItem( | 81 virtual WorkItem* AddDeleteTreeWorkItem( |
| 85 const base::FilePath& root_path, | 82 const base::FilePath& root_path, |
| 86 const base::FilePath& temp_path, | 83 const base::FilePath& temp_path, |
| 87 const std::vector<base::FilePath>& key_paths); | 84 const std::vector<base::FilePath>& key_paths); |
| 88 | 85 |
| 89 // Same as above but without support for key files. | 86 // Same as above but without support for key files. |
| 90 virtual WorkItem* AddDeleteTreeWorkItem(const base::FilePath& root_path, | 87 virtual WorkItem* AddDeleteTreeWorkItem(const base::FilePath& root_path, |
| 91 const base::FilePath& temp_path); | 88 const base::FilePath& temp_path); |
| 92 | 89 |
| 93 // Add a MoveTreeWorkItem to the list of work items. | 90 // Add a MoveTreeWorkItem to the list of work items. |
| 94 virtual WorkItem* AddMoveTreeWorkItem(const std::wstring& source_path, | 91 virtual WorkItem* AddMoveTreeWorkItem(const std::wstring& source_path, |
| 95 const std::wstring& dest_path, | 92 const std::wstring& dest_path, |
| 96 const std::wstring& temp_dir, | 93 const std::wstring& temp_dir, |
| 97 MoveTreeOption duplicate_option); | 94 MoveTreeOption duplicate_option); |
| 98 | 95 |
| 99 // Add a SetRegValueWorkItem that sets a registry value with REG_SZ type | 96 // Add a SetRegValueWorkItem that sets a registry value with REG_SZ type |
| 100 // at the key with specified path. | 97 // at the key with specified path. |
| 101 virtual WorkItem* AddSetRegValueWorkItem(HKEY predefined_root, | 98 virtual WorkItem* AddSetRegValueWorkItem(HKEY predefined_root, |
| 102 const std::wstring& key_path, | 99 const std::wstring& key_path, |
| 103 const std::wstring& value_name, | 100 const std::wstring& value_name, |
| 104 const std::wstring& value_data, | 101 const std::wstring& value_data, |
| 105 bool overwrite); | 102 bool overwrite, |
| 103 REGSAM wow64_access); |
| 106 | 104 |
| 107 // Add a SetRegValueWorkItem that sets a registry value with REG_DWORD type | 105 // Add a SetRegValueWorkItem that sets a registry value with REG_DWORD type |
| 108 // at the key with specified path. | 106 // at the key with specified path. |
| 109 virtual WorkItem* AddSetRegValueWorkItem(HKEY predefined_root, | 107 virtual WorkItem* AddSetRegValueWorkItem(HKEY predefined_root, |
| 110 const std::wstring& key_path, | 108 const std::wstring& key_path, |
| 111 const std::wstring& value_name, | 109 const std::wstring& value_name, |
| 112 DWORD value_data, | 110 DWORD value_data, |
| 113 bool overwrite); | 111 bool overwrite, |
| 112 REGSAM wow64_access); |
| 114 | 113 |
| 115 // Add a SetRegValueWorkItem that sets a registry value with REG_QWORD type | 114 // Add a SetRegValueWorkItem that sets a registry value with REG_QWORD type |
| 116 // at the key with specified path. | 115 // at the key with specified path. |
| 117 virtual WorkItem* AddSetRegValueWorkItem(HKEY predefined_root, | 116 virtual WorkItem* AddSetRegValueWorkItem(HKEY predefined_root, |
| 118 const std::wstring& key_path, | 117 const std::wstring& key_path, |
| 119 const std::wstring& value_name, | 118 const std::wstring& value_name, |
| 120 int64 value_data, | 119 int64 value_data, |
| 121 bool overwrite); | 120 bool overwrite, |
| 121 REGSAM wow64_access); |
| 122 | 122 |
| 123 // Add a SelfRegWorkItem that registers or unregisters a DLL at the | 123 // Add a SelfRegWorkItem that registers or unregisters a DLL at the |
| 124 // specified path. If user_level_registration is true, then alternate | 124 // specified path. If user_level_registration is true, then alternate |
| 125 // registration and unregistration entry point names will be used. | 125 // registration and unregistration entry point names will be used. |
| 126 virtual WorkItem* AddSelfRegWorkItem(const std::wstring& dll_path, | 126 virtual WorkItem* AddSelfRegWorkItem(const std::wstring& dll_path, |
| 127 bool do_register, | 127 bool do_register, |
| 128 bool user_level_registration); | 128 bool user_level_registration); |
| 129 | 129 |
| 130 protected: | 130 protected: |
| 131 friend class WorkItem; | 131 friend class WorkItem; |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 165 // Execute the WorkItems in the same order as they are added to the list. | 165 // Execute the WorkItems in the same order as they are added to the list. |
| 166 // If a WorkItem fails, the function will return failure but all other | 166 // If a WorkItem fails, the function will return failure but all other |
| 167 // WorkItems will still be executed. | 167 // WorkItems will still be executed. |
| 168 virtual bool Do(); | 168 virtual bool Do(); |
| 169 | 169 |
| 170 // No-op. | 170 // No-op. |
| 171 virtual void Rollback(); | 171 virtual void Rollback(); |
| 172 }; | 172 }; |
| 173 | 173 |
| 174 #endif // CHROME_INSTALLER_UTIL_WORK_ITEM_LIST_H_ | 174 #endif // CHROME_INSTALLER_UTIL_WORK_ITEM_LIST_H_ |
| OLD | NEW |