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

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

Issue 2273113002: Delete old files after an update. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@harvester
Patch Set: Created 4 years, 3 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 <memory> 10 #include <memory>
11 #include <set>
12 #include <string> 11 #include <string>
13 #include <vector> 12 #include <vector>
14 13
15 #include "base/files/file_path.h" 14 #include "base/files/file_path.h"
16 #include "base/logging.h" 15 #include "base/logging.h"
17 #include "base/macros.h" 16 #include "base/macros.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"
21 #include "build/build_config.h" 20 #include "build/build_config.h"
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after
178 bool IsChromeFrameRunning(const InstallationState& machine_state) const; 177 bool IsChromeFrameRunning(const InstallationState& machine_state) const;
179 178
180 // Returns true if any of the binaries from a multi-install Chrome Frame that 179 // Returns true if any of the binaries from a multi-install Chrome Frame that
181 // has been migrated to single-install are still in use. 180 // has been migrated to single-install are still in use.
182 bool AreBinariesInUse(const InstallationState& machine_state) const; 181 bool AreBinariesInUse(const InstallationState& machine_state) const;
183 182
184 // Returns the path to the installer under Chrome version folder 183 // Returns the path to the installer under Chrome version folder
185 // (for example <target_path>\Google\Chrome\Application\<Version>\Installer) 184 // (for example <target_path>\Google\Chrome\Application\<Version>\Installer)
186 base::FilePath GetInstallerDirectory(const base::Version& version) const; 185 base::FilePath GetInstallerDirectory(const base::Version& version) const;
187 186
188 // Try to delete all directories under |temp_path| whose versions are less
189 // than |new_version| and not equal to |existing_version|. |existing_version|
190 // may be NULL.
191 void RemoveOldVersionDirectories(const base::Version& new_version,
192 base::Version* existing_version,
193 const base::FilePath& temp_path) const;
194
195 // Adds to |com_dll_list| the list of COM DLLs that are to be registered 187 // Adds to |com_dll_list| the list of COM DLLs that are to be registered
196 // and/or unregistered. The list may be empty. 188 // and/or unregistered. The list may be empty.
197 void AddComDllList(std::vector<base::FilePath>* com_dll_list) const; 189 void AddComDllList(std::vector<base::FilePath>* com_dll_list) const;
198 190
199 // Sets the current stage of processing. This reports a progress value to 191 // Sets the current stage of processing. This reports a progress value to
200 // Google Update for presentation to a user. 192 // Google Update for presentation to a user.
201 void SetStage(InstallerStage stage) const; 193 void SetStage(InstallerStage stage) const;
202 194
203 // For a MULTI_INSTALL or MULTI_UPDATE operation, updates the Google Update 195 // For a MULTI_INSTALL or MULTI_UPDATE operation, updates the Google Update
204 // "ap" values for all products being operated on. 196 // "ap" values for all products being operated on.
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
244 const base::FilePath* product_dir) const; 236 const base::FilePath* product_dir) const;
245 Product* AddProductInDirectory(const base::FilePath* product_dir, 237 Product* AddProductInDirectory(const base::FilePath* product_dir,
246 std::unique_ptr<Product>* product); 238 std::unique_ptr<Product>* product);
247 Product* AddProductFromPreferences( 239 Product* AddProductFromPreferences(
248 BrowserDistribution::Type distribution_type, 240 BrowserDistribution::Type distribution_type,
249 const MasterPreferences& prefs, 241 const MasterPreferences& prefs,
250 const InstallationState& machine_state); 242 const InstallationState& machine_state);
251 bool IsMultiInstallUpdate(const MasterPreferences& prefs, 243 bool IsMultiInstallUpdate(const MasterPreferences& prefs,
252 const InstallationState& machine_state); 244 const InstallationState& machine_state);
253 245
254 // Enumerates all files named one of
255 // [chrome.exe, old_chrome.exe, new_chrome.exe] in target_path_ and
256 // returns their version numbers in a set.
257 void GetExistingExeVersions(std::set<std::string>* existing_versions) const;
258
259 // Sets this object's level and updates the root_key_ accordingly. 246 // Sets this object's level and updates the root_key_ accordingly.
260 void set_level(Level level); 247 void set_level(Level level);
261 248
262 // Sets this object's package type and updates the multi_package_distribution_ 249 // Sets this object's package type and updates the multi_package_distribution_
263 // accordingly. 250 // accordingly.
264 void set_package_type(PackageType type); 251 void set_package_type(PackageType type);
265 252
266 Operation operation_; 253 Operation operation_;
267 base::FilePath target_path_; 254 base::FilePath target_path_;
268 base::string16 state_key_; 255 base::string16 state_key_;
(...skipping 11 matching lines...) Expand all
280 bool background_mode_; 267 bool background_mode_;
281 bool verbose_logging_; 268 bool verbose_logging_;
282 269
283 private: 270 private:
284 DISALLOW_COPY_AND_ASSIGN(InstallerState); 271 DISALLOW_COPY_AND_ASSIGN(InstallerState);
285 }; // class InstallerState 272 }; // class InstallerState
286 273
287 } // namespace installer 274 } // namespace installer
288 275
289 #endif // CHROME_INSTALLER_UTIL_INSTALLER_STATE_H_ 276 #endif // CHROME_INSTALLER_UTIL_INSTALLER_STATE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698