From ab376cae3cd176f4aae8d67a5274891b66d9beda Mon Sep 17 00:00:00 2001 From: "mark@chromium.org" Date: Mon, 20 Jun 2011 22:01:35 +0000 Subject: [PATCH] Get rid of ClearByPathBackupExclusion. We planned on keeping ClearByPathBackupExclusion around as temporary code to clean up the mess we used to make in /Library/Preferences/com.apple.TimeMachine.plist. Evidently, when we ask CSBackupSetItemExcluded to include-by-path an item that was previously excluded by path, it will remove the ExcludeByPath entry for the path from that plist, but it will also add an IncludeByPath entry. There is no way using this API to clean up the mess we made in the past, we can only trade an "exclude" mess for an "include" mess. It's not worth attempting to modify the file ourselves, avoiding the CSBackupSetItemExcluded API, and it's probably not even possible because the plist will likely be rewritten by a system process anyway. BUG=86845, 85999 TEST=No changes made to the plist mentioned above. Review URL: http://codereview.chromium.org/7206030 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@89741 0039d316-1c4b-4281-b951-d872f2087c98 --- base/mac/mac_util.h | 6 ------ base/mac/mac_util.mm | 21 -------------------- chrome/browser/history/history_database.cc | 12 ----------- chrome/browser/history/thumbnail_database.cc | 12 ----------- 4 files changed, 51 deletions(-) diff --git a/base/mac/mac_util.h b/base/mac/mac_util.h index 0d101c97dcd937..7fe22c589496f0 100644 --- a/base/mac/mac_util.h +++ b/base/mac/mac_util.h @@ -81,12 +81,6 @@ void ActivateProcess(pid_t pid); // Excludes the file given by |file_path| from being backed up by Time Machine. bool SetFileBackupExclusion(const FilePath& file_path); -// TODO(mrossetti): Remove in M15. See http://crbug.com/85999 -// Remove possible exclude-by-path setting from |file_path|. Ignore errors since -// we don't care if the file does not exist or if it has not had its exclusion -// set by-path. This function is a NOOP for Mac OS X Lion or later. -void ClearByPathBackupExclusion(const FilePath& file_path); - // Sets the process name as displayed in Activity Monitor to process_name. void SetProcessName(CFStringRef process_name); diff --git a/base/mac/mac_util.mm b/base/mac/mac_util.mm index 100f23af3b972b..d3bb5a6ee3a085 100644 --- a/base/mac/mac_util.mm +++ b/base/mac/mac_util.mm @@ -242,28 +242,7 @@ void ActivateProcess(pid_t pid) { } } -// TODO(mrossetti): Remove in M15. See http://crbug.com/85999 -void ClearByPathBackupExclusion(const FilePath& file_path) { - if (IsOSSnowLeopardOrEarlier()) { - NSString* file_path_ns = - [NSString stringWithUTF8String:file_path.value().c_str()]; - NSURL* file_url = [NSURL fileURLWithPath:file_path_ns]; - // Ignore errors since the file may not exist. - CSBackupSetItemExcluded(base::mac::NSToCFCast(file_url), FALSE, TRUE); - } -} - bool SetFileBackupExclusion(const FilePath& file_path) { - // Do a pre-emptive unexclude by-path since by-path exclusions may have - // been performed on this file in the past. This feature is available to - // administrative users in 10.5 and 10.6, but is restricted to the root - // user in 10.7. Since it logs messages to the console in 10.7 and - // wouldn't work anyway, avoid calling it altogether in that version. - // - // TODO(mrossetti): Remove on the trunk after September - // 2011, M15. http://crbug.com/85999 - ClearByPathBackupExclusion(file_path); - NSString* file_path_ns = [NSString stringWithUTF8String:file_path.value().c_str()]; NSURL* file_url = [NSURL fileURLWithPath:file_path_ns]; diff --git a/chrome/browser/history/history_database.cc b/chrome/browser/history/history_database.cc index 6539b233aad78f..c1ed0c9fc97106 100644 --- a/chrome/browser/history/history_database.cc +++ b/chrome/browser/history/history_database.cc @@ -68,18 +68,6 @@ HistoryDatabase::~HistoryDatabase() { sql::InitStatus HistoryDatabase::Init(const FilePath& history_name, const FilePath& bookmarks_path) { -#if defined(OS_MACOSX) - // TODO(mrossetti): Remove in M15. See http://crbug.com/85999 - // NOTE: Do not remove the SetFileBackupExclusion call below as part of this - // cleanup. - // Do a pre-emptive unexclude by-path since by-path exclusions may have - // been performed on this file in the past. - FilePath::StringType journal_name(history_name.value()); - journal_name.append("-journal"); - FilePath journal_path(journal_name); - base::mac::ClearByPathBackupExclusion(journal_path); -#endif - // Set the exceptional sqlite error handler. db_.set_error_delegate(GetErrorHandlerForHistoryDb()); diff --git a/chrome/browser/history/thumbnail_database.cc b/chrome/browser/history/thumbnail_database.cc index 977677ff7ed8ca..e9d57307372927 100644 --- a/chrome/browser/history/thumbnail_database.cc +++ b/chrome/browser/history/thumbnail_database.cc @@ -56,18 +56,6 @@ sql::InitStatus ThumbnailDatabase::Init( const FilePath& db_name, const HistoryPublisher* history_publisher, URLDatabase* url_db) { -#if defined(OS_MACOSX) - // TODO(mrossetti): Remove in M15. See http://crbug.com/85999 - // NOTE: Do not remove the SetFileBackupExclusion call below as part of this - // cleanup. - // Do a pre-emptive unexclude by-path since by-path exclusions may have - // been performed on this file in the past. - FilePath::StringType journal_name(db_name.value()); - journal_name.append("-journal"); - FilePath journal_path(journal_name); - base::mac::ClearByPathBackupExclusion(journal_path); -#endif - history_publisher_ = history_publisher; sql::InitStatus status = OpenDatabase(&db_, db_name); if (status != sql::INIT_OK)