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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 // Courgette's flavor of bsdiff. Returns 0 in case of success, or | 42 // Courgette's flavor of bsdiff. Returns 0 in case of success, or |
43 // kBsdiffErrorOffset + a bsdiff status code in case of errors. | 43 // kBsdiffErrorOffset + a bsdiff status code in case of errors. |
44 // See courgette/third_party/bsdiff.h for details. | 44 // See courgette/third_party/bsdiff.h for details. |
45 int BsdiffPatchFiles(const base::FilePath& src, | 45 int BsdiffPatchFiles(const base::FilePath& src, |
46 const base::FilePath& patch, | 46 const base::FilePath& patch, |
47 const base::FilePath& dest); | 47 const base::FilePath& dest); |
48 | 48 |
49 // Find the version of Chrome from an install source directory. | 49 // Find the version of Chrome from an install source directory. |
50 // Chrome_path should contain at least one version folder. | 50 // Chrome_path should contain at least one version folder. |
51 // Returns the maximum version found or NULL if no version is found. | 51 // Returns the maximum version found or NULL if no version is found. |
52 base::Version* GetMaxVersionFromArchiveDir(const base::FilePath& chrome_path); | 52 Version* GetMaxVersionFromArchiveDir(const base::FilePath& chrome_path); |
53 | 53 |
54 // Returns the uncompressed archive of the installed version that serves as the | 54 // Returns the uncompressed archive of the installed version that serves as the |
55 // source for patching. If |desired_version| is valid, only the path to that | 55 // source for patching. If |desired_version| is valid, only the path to that |
56 // version will be returned, or empty if it doesn't exist. | 56 // version will be returned, or empty if it doesn't exist. |
57 base::FilePath FindArchiveToPatch(const InstallationState& original_state, | 57 base::FilePath FindArchiveToPatch(const InstallationState& original_state, |
58 const InstallerState& installer_state, | 58 const InstallerState& installer_state, |
59 const base::Version& desired_version); | 59 const base::Version& desired_version); |
60 | 60 |
61 // Spawns a new process that waits for a specified amount of time before | 61 // Spawns a new process that waits for a specified amount of time before |
62 // attempting to delete |path|. This is useful for setup to delete the | 62 // attempting to delete |path|. This is useful for setup to delete the |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
149 // The previous state of the privilege this object is responsible for. As set | 149 // The previous state of the privilege this object is responsible for. As set |
150 // by AdjustTokenPrivileges() upon construction. | 150 // by AdjustTokenPrivileges() upon construction. |
151 TOKEN_PRIVILEGES previous_privileges_; | 151 TOKEN_PRIVILEGES previous_privileges_; |
152 | 152 |
153 DISALLOW_IMPLICIT_CONSTRUCTORS(ScopedTokenPrivilege); | 153 DISALLOW_IMPLICIT_CONSTRUCTORS(ScopedTokenPrivilege); |
154 }; | 154 }; |
155 | 155 |
156 } // namespace installer | 156 } // namespace installer |
157 | 157 |
158 #endif // CHROME_INSTALLER_SETUP_SETUP_UTIL_H_ | 158 #endif // CHROME_INSTALLER_SETUP_SETUP_UTIL_H_ |
OLD | NEW |