diff options
author | robertshield@chromium.org <robertshield@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-07-23 14:39:11 +0000 |
---|---|---|
committer | robertshield@chromium.org <robertshield@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-07-23 14:39:11 +0000 |
commit | 14d5e6acc2c56022b8c74d18f9f953f1e1b4d453 (patch) | |
tree | 20856944a0e00c0ea543964b5bab2d894b203506 /chrome/installer | |
parent | 7ee1a44c27384650612290a18ccbe736e0e4b955 (diff) | |
download | chromium_src-14d5e6acc2c56022b8c74d18f9f953f1e1b4d453.zip chromium_src-14d5e6acc2c56022b8c74d18f9f953f1e1b4d453.tar.gz chromium_src-14d5e6acc2c56022b8c74d18f9f953f1e1b4d453.tar.bz2 |
During installer cleanup, replace the use of rollback-able DeleteTreeWorkItems with simple deletes, since we don't care to rollback the attempts to delete our temp files. This avoids a redundant copy and deletion of the temp files.
BUG=25878
TEST=Chrome / Chrome Frame installer spends less time between the verbose log traces "Deleting temporary directory" and "list execution succeeded".
Review URL: http://codereview.chromium.org/2870066
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@53469 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/installer')
-rw-r--r-- | chrome/installer/setup/setup_main.cc | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/chrome/installer/setup/setup_main.cc b/chrome/installer/setup/setup_main.cc index 9cfbf4a..cf84b18 100644 --- a/chrome/installer/setup/setup_main.cc +++ b/chrome/installer/setup/setup_main.cc @@ -347,15 +347,15 @@ installer_util::InstallStatus InstallChrome(const CommandLine& cmd_line, } // Delete temporary files. These include install temporary directory - // and master profile file if present. - scoped_ptr<WorkItemList> cleanup_list(WorkItem::CreateWorkItemList()); + // and master profile file if present. Note that we do not care about rollback + // here and we schedule for deletion on reboot below if the deletes fail. As + // such, we do not use DeleteTreeWorkItem. LOG(INFO) << "Deleting temporary directory " << temp_path.value(); - cleanup_list->AddDeleteTreeWorkItem(temp_path.ToWStringHack(), - std::wstring()); + bool cleanup_success = file_util::Delete(temp_path, true); if (cmd_line.HasSwitch(installer_util::switches::kInstallerData)) { std::wstring prefs_path = cmd_line.GetSwitchValue( installer_util::switches::kInstallerData); - cleanup_list->AddDeleteTreeWorkItem(prefs_path, std::wstring()); + cleanup_success = file_util::Delete(prefs_path, true) && cleanup_success; } // The above cleanup has been observed to fail on several users machines. @@ -364,7 +364,7 @@ installer_util::InstallStatus InstallChrome(const CommandLine& cmd_line, // as we end up filling users' disks with large-ish temp files. To mitigate // this, if we fail to delete the temp folders, then schedule them for // deletion at next reboot. - if (!cleanup_list->Do()) { + if (!cleanup_success) { ScheduleDirectoryForDeletion(temp_path.ToWStringHack().c_str()); if (cmd_line.HasSwitch(installer_util::switches::kInstallerData)) { std::wstring prefs_path = cmd_line.GetSwitchValue( |