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

Side by Side Diff: chrome/installer/util/installer_state.h

Issue 1666363002: Delete old files after an update. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix return type Created 4 years, 9 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 #ifndef CHROME_INSTALLER_UTIL_INSTALLER_STATE_H_ 5 #ifndef CHROME_INSTALLER_UTIL_INSTALLER_STATE_H_
6 #define CHROME_INSTALLER_UTIL_INSTALLER_STATE_H_ 6 #define CHROME_INSTALLER_UTIL_INSTALLER_STATE_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <set>
11 #include <string> 10 #include <string>
12 #include <vector> 11 #include <vector>
13 12
14 #include "base/files/file_path.h" 13 #include "base/files/file_path.h"
15 #include "base/logging.h" 14 #include "base/logging.h"
16 #include "base/macros.h" 15 #include "base/macros.h"
17 #include "base/memory/scoped_ptr.h" 16 #include "base/memory/scoped_ptr.h"
18 #include "base/memory/scoped_vector.h" 17 #include "base/memory/scoped_vector.h"
19 #include "base/strings/string16.h" 18 #include "base/strings/string16.h"
20 #include "base/version.h" 19 #include "base/version.h"
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after
171 bool IsChromeFrameRunning(const InstallationState& machine_state) const; 170 bool IsChromeFrameRunning(const InstallationState& machine_state) const;
172 171
173 // Returns true if any of the binaries from a multi-install Chrome Frame that 172 // Returns true if any of the binaries from a multi-install Chrome Frame that
174 // has been migrated to single-install are still in use. 173 // has been migrated to single-install are still in use.
175 bool AreBinariesInUse(const InstallationState& machine_state) const; 174 bool AreBinariesInUse(const InstallationState& machine_state) const;
176 175
177 // Returns the path to the installer under Chrome version folder 176 // Returns the path to the installer under Chrome version folder
178 // (for example <target_path>\Google\Chrome\Application\<Version>\Installer) 177 // (for example <target_path>\Google\Chrome\Application\<Version>\Installer)
179 base::FilePath GetInstallerDirectory(const base::Version& version) const; 178 base::FilePath GetInstallerDirectory(const base::Version& version) const;
180 179
181 // Try to delete all directories under |temp_path| whose versions are less
182 // than |new_version| and not equal to |existing_version|. |existing_version|
183 // may be NULL.
184 void RemoveOldVersionDirectories(const base::Version& new_version,
185 base::Version* existing_version,
186 const base::FilePath& temp_path) const;
187
188 // Adds to |com_dll_list| the list of COM DLLs that are to be registered 180 // Adds to |com_dll_list| the list of COM DLLs that are to be registered
189 // and/or unregistered. The list may be empty. 181 // and/or unregistered. The list may be empty.
190 void AddComDllList(std::vector<base::FilePath>* com_dll_list) const; 182 void AddComDllList(std::vector<base::FilePath>* com_dll_list) const;
191 183
192 // See InstallUtil::UpdateInstallerStage. 184 // See InstallUtil::UpdateInstallerStage.
193 void UpdateStage(installer::InstallerStage stage) const; 185 void UpdateStage(installer::InstallerStage stage) const;
194 186
195 // For a MULTI_INSTALL or MULTI_UPDATE operation, updates the Google Update 187 // For a MULTI_INSTALL or MULTI_UPDATE operation, updates the Google Update
196 // "ap" values for all products being operated on. 188 // "ap" values for all products being operated on.
197 void UpdateChannels() const; 189 void UpdateChannels() const;
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
236 const base::FilePath* product_dir) const; 228 const base::FilePath* product_dir) const;
237 Product* AddProductInDirectory(const base::FilePath* product_dir, 229 Product* AddProductInDirectory(const base::FilePath* product_dir,
238 scoped_ptr<Product>* product); 230 scoped_ptr<Product>* product);
239 Product* AddProductFromPreferences( 231 Product* AddProductFromPreferences(
240 BrowserDistribution::Type distribution_type, 232 BrowserDistribution::Type distribution_type,
241 const MasterPreferences& prefs, 233 const MasterPreferences& prefs,
242 const InstallationState& machine_state); 234 const InstallationState& machine_state);
243 bool IsMultiInstallUpdate(const MasterPreferences& prefs, 235 bool IsMultiInstallUpdate(const MasterPreferences& prefs,
244 const InstallationState& machine_state); 236 const InstallationState& machine_state);
245 237
246 // Enumerates all files named one of
247 // [chrome.exe, old_chrome.exe, new_chrome.exe] in target_path_ and
248 // returns their version numbers in a set.
249 void GetExistingExeVersions(std::set<std::string>* existing_versions) const;
250
251 // Sets this object's level and updates the root_key_ accordingly. 238 // Sets this object's level and updates the root_key_ accordingly.
252 void set_level(Level level); 239 void set_level(Level level);
253 240
254 // Sets this object's package type and updates the multi_package_distribution_ 241 // Sets this object's package type and updates the multi_package_distribution_
255 // accordingly. 242 // accordingly.
256 void set_package_type(PackageType type); 243 void set_package_type(PackageType type);
257 244
258 Operation operation_; 245 Operation operation_;
259 base::FilePath target_path_; 246 base::FilePath target_path_;
260 base::string16 state_key_; 247 base::string16 state_key_;
261 BrowserDistribution::Type state_type_; 248 BrowserDistribution::Type state_type_;
262 ScopedVector<Product> products_; 249 ScopedVector<Product> products_;
263 BrowserDistribution* multi_package_distribution_; 250 BrowserDistribution* multi_package_distribution_;
264 base::Version critical_update_version_; 251 base::Version critical_update_version_;
265 Level level_; 252 Level level_;
266 PackageType package_type_; 253 PackageType package_type_;
267 #if defined(OS_WIN) 254 #if defined(OS_WIN)
268 HKEY root_key_; 255 HKEY root_key_;
269 #endif 256 #endif
270 bool msi_; 257 bool msi_;
271 bool verbose_logging_; 258 bool verbose_logging_;
272 259
273 private: 260 private:
274 DISALLOW_COPY_AND_ASSIGN(InstallerState); 261 DISALLOW_COPY_AND_ASSIGN(InstallerState);
275 }; // class InstallerState 262 }; // class InstallerState
276 263
277 } // namespace installer 264 } // namespace installer
278 265
279 #endif // CHROME_INSTALLER_UTIL_INSTALLER_STATE_H_ 266 #endif // CHROME_INSTALLER_UTIL_INSTALLER_STATE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698