Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 // This file declares util functions for setup project. It also declares a | 5 // This file declares util functions for setup project. It also declares a |
| 6 // few functions that the Chrome component updater uses for patching binary | 6 // few functions that the Chrome component updater uses for patching binary |
| 7 // deltas. | 7 // deltas. |
| 8 | 8 |
| 9 #ifndef CHROME_INSTALLER_SETUP_SETUP_UTIL_H_ | 9 #ifndef CHROME_INSTALLER_SETUP_SETUP_UTIL_H_ |
| 10 #define CHROME_INSTALLER_SETUP_SETUP_UTIL_H_ | 10 #define CHROME_INSTALLER_SETUP_SETUP_UTIL_H_ |
| (...skipping 15 matching lines...) Expand all Loading... | |
| 26 class CommandLine; | 26 class CommandLine; |
| 27 class FilePath; | 27 class FilePath; |
| 28 class Version; | 28 class Version; |
| 29 } | 29 } |
| 30 | 30 |
| 31 namespace installer { | 31 namespace installer { |
| 32 | 32 |
| 33 class InstallationState; | 33 class InstallationState; |
| 34 class InstallerState; | 34 class InstallerState; |
| 35 class ProductState; | 35 class ProductState; |
| 36 class MasterPreferences; | |
| 36 | 37 |
| 37 // Applies a patch file to source file using Courgette. Returns 0 in case of | 38 // Applies a patch file to source file using Courgette. Returns 0 in case of |
| 38 // success. In case of errors, it returns kCourgetteErrorOffset + a Courgette | 39 // success. In case of errors, it returns kCourgetteErrorOffset + a Courgette |
| 39 // status code, as defined in courgette/courgette.h | 40 // status code, as defined in courgette/courgette.h |
| 40 int CourgettePatchFiles(const base::FilePath& src, | 41 int CourgettePatchFiles(const base::FilePath& src, |
| 41 const base::FilePath& patch, | 42 const base::FilePath& patch, |
| 42 const base::FilePath& dest); | 43 const base::FilePath& dest); |
| 43 | 44 |
| 44 // Applies a patch file to source file using bsdiff. This function uses | 45 // Applies a patch file to source file using bsdiff. This function uses |
| 45 // Courgette's flavor of bsdiff. Returns 0 in case of success, or | 46 // Courgette's flavor of bsdiff. Returns 0 in case of success, or |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 113 // The key itself is deleted if no subkeys are preserved. | 114 // The key itself is deleted if no subkeys are preserved. |
| 114 void DeleteRegistryKeyPartial( | 115 void DeleteRegistryKeyPartial( |
| 115 HKEY root, | 116 HKEY root, |
| 116 const base::string16& path, | 117 const base::string16& path, |
| 117 const std::vector<base::string16>& keys_to_preserve); | 118 const std::vector<base::string16>& keys_to_preserve); |
| 118 | 119 |
| 119 // Converts a product GUID into a SQuished gUID that is used for MSI installer | 120 // Converts a product GUID into a SQuished gUID that is used for MSI installer |
| 120 // registry entries. | 121 // registry entries. |
| 121 base::string16 GuidToSquid(const base::string16& guid); | 122 base::string16 GuidToSquid(const base::string16& guid); |
| 122 | 123 |
| 124 bool IsRollbackEnabled(const MasterPreferences& prefs); | |
|
Georges Khalil
2016/04/27 12:38:02
nit: Add comment.
nit: I think naming this CanRoll
zmin
2016/04/27 15:20:18
Done.
| |
| 125 | |
| 123 // This class will enable the privilege defined by |privilege_name| on the | 126 // This class will enable the privilege defined by |privilege_name| on the |
| 124 // current process' token. The privilege will be disabled upon the | 127 // current process' token. The privilege will be disabled upon the |
| 125 // ScopedTokenPrivilege's destruction (unless it was already enabled when the | 128 // ScopedTokenPrivilege's destruction (unless it was already enabled when the |
| 126 // ScopedTokenPrivilege object was constructed). | 129 // ScopedTokenPrivilege object was constructed). |
| 127 // Some privileges might require admin rights to be enabled (check is_enabled() | 130 // Some privileges might require admin rights to be enabled (check is_enabled() |
| 128 // to know whether |privilege_name| was successfully enabled). | 131 // to know whether |privilege_name| was successfully enabled). |
| 129 class ScopedTokenPrivilege { | 132 class ScopedTokenPrivilege { |
| 130 public: | 133 public: |
| 131 explicit ScopedTokenPrivilege(const wchar_t* privilege_name); | 134 explicit ScopedTokenPrivilege(const wchar_t* privilege_name); |
| 132 ~ScopedTokenPrivilege(); | 135 ~ScopedTokenPrivilege(); |
| (...skipping 12 matching lines...) Expand all Loading... | |
| 145 // The previous state of the privilege this object is responsible for. As set | 148 // The previous state of the privilege this object is responsible for. As set |
| 146 // by AdjustTokenPrivileges() upon construction. | 149 // by AdjustTokenPrivileges() upon construction. |
| 147 TOKEN_PRIVILEGES previous_privileges_; | 150 TOKEN_PRIVILEGES previous_privileges_; |
| 148 | 151 |
| 149 DISALLOW_IMPLICIT_CONSTRUCTORS(ScopedTokenPrivilege); | 152 DISALLOW_IMPLICIT_CONSTRUCTORS(ScopedTokenPrivilege); |
| 150 }; | 153 }; |
| 151 | 154 |
| 152 } // namespace installer | 155 } // namespace installer |
| 153 | 156 |
| 154 #endif // CHROME_INSTALLER_SETUP_SETUP_UTIL_H_ | 157 #endif // CHROME_INSTALLER_SETUP_SETUP_UTIL_H_ |
| OLD | NEW |