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

Unified Diff: chrome/installer/setup/install_worker.cc

Issue 1986823002: Reset user data directory and disk cache directory after downgrade. (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 side-by-side diff with in-line comments
Download patch
Index: chrome/installer/setup/install_worker.cc
diff --git a/chrome/installer/setup/install_worker.cc b/chrome/installer/setup/install_worker.cc
index 830a3a3aed1f1af56770b425ebabd80b43fcdaa1..3d9f177d7602183bd2be2259d84c13c00adf1d44 100644
--- a/chrome/installer/setup/install_worker.cc
+++ b/chrome/installer/setup/install_worker.cc
@@ -228,7 +228,7 @@ void AddProductSpecificWorkItems(const InstallationState& original_state,
const InstallerState& installer_state,
const base::FilePath& setup_path,
const Version& new_version,
- bool is_new_install,
+ const Version* current_version,
bool add_language_identifier,
WorkItemList* list) {
const Products& products = installer_state.products();
@@ -238,8 +238,8 @@ void AddProductSpecificWorkItems(const InstallationState& original_state,
if (p.is_chrome()) {
AddOsUpgradeWorkItems(installer_state, setup_path, new_version, p,
list);
- AddFirewallRulesWorkItems(
- installer_state, p.distribution(), is_new_install, list);
+ AddFirewallRulesWorkItems(installer_state, p.distribution(),
+ current_version == nullptr, list);
#if defined(GOOGLE_CHROME_BUILD)
if (!InstallUtil::IsChromeSxSProcess()) {
@@ -249,6 +249,13 @@ void AddProductSpecificWorkItems(const InstallationState& original_state,
new_version, add_language_identifier, list);
}
#endif // GOOGLE_CHROME_BUILD
+ if (*current_version > new_version) {
+ InstallUtil::AddSetDowngradeVersionItem(installer_state.root_key(),
grt (UTC plus 2) 2016/05/19 23:39:28 if you collapse these two functions into one AddDo
zmin 2016/05/20 00:52:25 Done.
+ *current_version, list);
+ } else if (*current_version < new_version) {
+ InstallUtil::AddRemoveDowngradeVersionItem(installer_state.root_key(),
+ new_version, list);
+ }
}
if (p.is_chrome_binaries())
AddQuickEnableChromeFrameWorkItems(installer_state, list);
@@ -1119,13 +1126,9 @@ void AddInstallWorkItems(const InstallationState& original_state,
// Add any remaining work items that involve special settings for
// each product.
- AddProductSpecificWorkItems(original_state,
- installer_state,
- setup_path,
- new_version,
- current_version == NULL,
- add_language_identifier,
- install_list);
+ AddProductSpecificWorkItems(original_state, installer_state, setup_path,
+ new_version, current_version,
+ add_language_identifier, install_list);
// Copy over brand, usagestats, and other values.
AddGoogleUpdateWorkItems(original_state, installer_state, install_list);

Powered by Google App Engine
This is Rietveld 408576698