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

Unified Diff: chrome/app/chrome_main_delegate.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: Created 4 years, 6 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
« no previous file with comments | « no previous file | chrome/browser/chrome_browser_main.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/app/chrome_main_delegate.cc
diff --git a/chrome/app/chrome_main_delegate.cc b/chrome/app/chrome_main_delegate.cc
index 1626ff468513076ad064a3eef600a8dade50ee9b..22ed2aa8b65964e7a3610be177e29f07a6fe52c1 100644
--- a/chrome/app/chrome_main_delegate.cc
+++ b/chrome/app/chrome_main_delegate.cc
@@ -60,6 +60,7 @@
#include <malloc.h>
#include <algorithm>
#include "base/debug/close_handle_hook_win.h"
+#include "chrome/browser/downgrade/user_data_downgrade.h"
#include "chrome/common/child_process_logging.h"
#include "chrome/common/v8_breakpad_support_win.h"
#include "components/crash/content/app/crashpad.h"
@@ -732,8 +733,17 @@ void ChromeMainDelegate::PreSandboxStartup() {
#endif
// Initialize the user data dir for any process type that needs it.
- if (chrome::ProcessNeedsProfileDir(process_type))
+ if (chrome::ProcessNeedsProfileDir(process_type)) {
InitializeUserDataDir();
+#if defined(OS_WIN) && !defined(CHROME_MULTIPLE_DLL_CHILD)
+ if (downgrade::IsMSIInstall()) {
+ downgrade::MoveUserDataForFirstRunAfterDowngrade();
+ base::FilePath user_data_dir;
+ if (PathService::Get(chrome::DIR_USER_DATA, &user_data_dir))
+ downgrade::UpdateLastVersion(user_data_dir);
+ }
+#endif
+ }
// Register component_updater PathProvider after DIR_USER_DATA overidden by
// command line flags. Maybe move the chrome PathProvider down here also?
« no previous file with comments | « no previous file | chrome/browser/chrome_browser_main.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698