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

Side by Side Diff: chrome/browser/downgrade/user_data_downgrade.h

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
(Empty)
1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef CHROME_BROWSER_DOWNGRADE_USER_DATA_DOWNGRADE_H_
6 #define CHROME_BROWSER_DOWNGRADE_USER_DATA_DOWNGRADE_H_
7
8 #include "base/files/file_path.h"
9 #include "base/version.h"
10
11 // The suffix of pending deleted directory.
12 extern const base::FilePath::CharType g_downgrade_delete_suffix[];
grt (UTC plus 2) 2016/06/07 01:25:28 these are constants, so use kFoo naming
zmin 2016/06/07 14:41:49 Done.
13 // The name of "Browser Version" file.
14 extern const base::FilePath::CharType g_downgrade_browser_version_file[];
15
16 // Moves aside all directories containing user data to prevent the browser from
17 // reading them when Chrome is downgraded from a higher version. When called
18 // early in startup, this will result in the browser performing first-run for
19 // the user. To avoid long-running I/O operations, this function merely moves
20 // directories aside. A subsequent call to DeleteMovedUserDataSoon (below) must
21 // be made later in startup to free up disk space.
22 void MoveUserDataForFirstRunAfterDowngrade();
23
24 // Update the content of "Browser Version" file with current version number
25 // in |user_data_dir|.
26 void UpdateBrowserVersion(const base::FilePath& user_data_dir);
27
28 // Get the content of "Browser Version" file in |user_data_dir|.
29 base::Version GetBrowserVersion(const base::FilePath& user_data_dir);
30
31 // Schedules a search for the removal of any directories moved aside by
32 // MoveUserDataForFirstRunAfterDowngrade. This operation is idempotent,
33 // and may be safely called when no such directories exist.
34 void DeleteMovedUserDataSoon();
35
36 // Changes the behavior of the above functions to simulate a downgrade for use
37 // in tests. MoveUserDataForFirstRunAfterDowngrade will no longer rely on
38 // registry and DeleteMovedUserDataSoon will always post task into blocking
39 // pool for brower test.
40 void SimulateDowngradeForTest(bool is_browser_test);
41
42 #endif // CHROME_BROWSER_DOWNGRADE_USER_DATA_DOWNGRADE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698