Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(131)

Side by Side Diff: chrome/installer/setup/setup_util.h

Issue 1914213002: Support rollback with installerdata in mini_installer (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: cr Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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 // Returns true if downgrade is allowed by installer data.
125 bool CanDowngradeVersion(const MasterPreferences& prefs);
grt (UTC plus 2) 2016/04/28 16:55:30 IsDowngradeAllowed?
zmin 2016/04/28 17:51:29 Actually I love this one. How about you, @georgesa
126
123 // This class will enable the privilege defined by |privilege_name| on the 127 // This class will enable the privilege defined by |privilege_name| on the
124 // current process' token. The privilege will be disabled upon the 128 // current process' token. The privilege will be disabled upon the
125 // ScopedTokenPrivilege's destruction (unless it was already enabled when the 129 // ScopedTokenPrivilege's destruction (unless it was already enabled when the
126 // ScopedTokenPrivilege object was constructed). 130 // ScopedTokenPrivilege object was constructed).
127 // Some privileges might require admin rights to be enabled (check is_enabled() 131 // Some privileges might require admin rights to be enabled (check is_enabled()
128 // to know whether |privilege_name| was successfully enabled). 132 // to know whether |privilege_name| was successfully enabled).
129 class ScopedTokenPrivilege { 133 class ScopedTokenPrivilege {
130 public: 134 public:
131 explicit ScopedTokenPrivilege(const wchar_t* privilege_name); 135 explicit ScopedTokenPrivilege(const wchar_t* privilege_name);
132 ~ScopedTokenPrivilege(); 136 ~ScopedTokenPrivilege();
(...skipping 12 matching lines...) Expand all
145 // 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
146 // by AdjustTokenPrivileges() upon construction. 150 // by AdjustTokenPrivileges() upon construction.
147 TOKEN_PRIVILEGES previous_privileges_; 151 TOKEN_PRIVILEGES previous_privileges_;
148 152
149 DISALLOW_IMPLICIT_CONSTRUCTORS(ScopedTokenPrivilege); 153 DISALLOW_IMPLICIT_CONSTRUCTORS(ScopedTokenPrivilege);
150 }; 154 };
151 155
152 } // namespace installer 156 } // namespace installer
153 157
154 #endif // CHROME_INSTALLER_SETUP_SETUP_UTIL_H_ 158 #endif // CHROME_INSTALLER_SETUP_SETUP_UTIL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698