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

Side by Side 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: cr 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 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 #include "chrome/app/chrome_main_delegate.h" 5 #include "chrome/app/chrome_main_delegate.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <string> 8 #include <string>
9 9
10 #include "base/base_paths.h" 10 #include "base/base_paths.h"
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 #include "extensions/common/constants.h" 53 #include "extensions/common/constants.h"
54 #include "ui/base/material_design/material_design_controller.h" 54 #include "ui/base/material_design/material_design_controller.h"
55 #include "ui/base/resource/resource_bundle.h" 55 #include "ui/base/resource/resource_bundle.h"
56 #include "ui/base/ui_base_switches.h" 56 #include "ui/base/ui_base_switches.h"
57 57
58 #if defined(OS_WIN) 58 #if defined(OS_WIN)
59 #include <atlbase.h> 59 #include <atlbase.h>
60 #include <malloc.h> 60 #include <malloc.h>
61 #include <algorithm> 61 #include <algorithm>
62 #include "base/debug/close_handle_hook_win.h" 62 #include "base/debug/close_handle_hook_win.h"
63 #include "chrome/browser/downgrade/user_data_downgrade.h"
63 #include "chrome/common/child_process_logging.h" 64 #include "chrome/common/child_process_logging.h"
64 #include "chrome/common/v8_breakpad_support_win.h" 65 #include "chrome/common/v8_breakpad_support_win.h"
65 #include "components/crash/content/app/crashpad.h" 66 #include "components/crash/content/app/crashpad.h"
66 #include "sandbox/win/src/sandbox.h" 67 #include "sandbox/win/src/sandbox.h"
67 #include "ui/base/resource/resource_bundle_win.h" 68 #include "ui/base/resource/resource_bundle_win.h"
68 #endif 69 #endif
69 70
70 #if defined(OS_MACOSX) 71 #if defined(OS_MACOSX)
71 #include "base/mac/foundation_util.h" 72 #include "base/mac/foundation_util.h"
72 #include "chrome/app/chrome_main_mac.h" 73 #include "chrome/app/chrome_main_mac.h"
(...skipping 639 matching lines...) Expand 10 before | Expand all | Expand 10 after
712 #if defined(OS_WIN) 713 #if defined(OS_WIN)
713 child_process_logging::Init(); 714 child_process_logging::Init();
714 #endif 715 #endif
715 #if defined(ARCH_CPU_ARM_FAMILY) && (defined(OS_ANDROID) || defined(OS_LINUX)) 716 #if defined(ARCH_CPU_ARM_FAMILY) && (defined(OS_ANDROID) || defined(OS_LINUX))
716 // Create an instance of the CPU class to parse /proc/cpuinfo and cache 717 // Create an instance of the CPU class to parse /proc/cpuinfo and cache
717 // cpu_brand info. 718 // cpu_brand info.
718 base::CPU cpu_info; 719 base::CPU cpu_info;
719 #endif 720 #endif
720 721
721 // Initialize the user data dir for any process type that needs it. 722 // Initialize the user data dir for any process type that needs it.
722 if (chrome::ProcessNeedsProfileDir(process_type)) 723 if (chrome::ProcessNeedsProfileDir(process_type)) {
723 InitializeUserDataDir(); 724 InitializeUserDataDir();
725 #if defined(OS_WIN) && !defined(CHROME_MULTIPLE_DLL_CHILD)
726 MoveUserDataForFirstRunAfterDowngrade();
grt (UTC plus 2) 2016/06/07 01:25:28 since the first thing Move... does is get DIR_USER
zmin 2016/06/07 14:41:49 MoveUserDataForFirstRunAfterDowngrade() not only m
grt (UTC plus 2) 2016/06/07 15:40:43 That's a good argument. Why does UpdateBrowserVers
727 base::FilePath user_data_dir;
728 if (PathService::Get(chrome::DIR_USER_DATA, &user_data_dir))
729 UpdateBrowserVersion(user_data_dir);
730 #endif
731 }
724 732
725 // Register component_updater PathProvider after DIR_USER_DATA overidden by 733 // Register component_updater PathProvider after DIR_USER_DATA overidden by
726 // command line flags. Maybe move the chrome PathProvider down here also? 734 // command line flags. Maybe move the chrome PathProvider down here also?
727 component_updater::RegisterPathProvider(chrome::DIR_USER_DATA); 735 component_updater::RegisterPathProvider(chrome::DIR_USER_DATA);
728 736
729 // Enable Message Loop related state asap. 737 // Enable Message Loop related state asap.
730 if (command_line.HasSwitch(switches::kMessageLoopHistogrammer)) 738 if (command_line.HasSwitch(switches::kMessageLoopHistogrammer))
731 base::MessageLoop::EnableHistogrammer(true); 739 base::MessageLoop::EnableHistogrammer(true);
732 740
733 #if !defined(OS_ANDROID) && !defined(OS_WIN) 741 #if !defined(OS_ANDROID) && !defined(OS_WIN)
(...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after
1019 case version_info::Channel::CANARY: 1027 case version_info::Channel::CANARY:
1020 return true; 1028 return true;
1021 case version_info::Channel::DEV: 1029 case version_info::Channel::DEV:
1022 case version_info::Channel::BETA: 1030 case version_info::Channel::BETA:
1023 case version_info::Channel::STABLE: 1031 case version_info::Channel::STABLE:
1024 default: 1032 default:
1025 // Don't enable instrumentation. 1033 // Don't enable instrumentation.
1026 return false; 1034 return false;
1027 } 1035 }
1028 } 1036 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/chrome_browser_main.cc » ('j') | chrome/browser/downgrade/user_data_downgrade.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698