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

Unified Diff: chrome/installer/util/delete_tree_work_item.cc

Issue 276016: Remove some deprecated file_util wstring functions. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: lint Created 11 years, 2 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 | « chrome/installer/util/delete_tree_work_item.h ('k') | chrome/installer/util/move_tree_work_item.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/installer/util/delete_tree_work_item.cc
===================================================================
--- chrome/installer/util/delete_tree_work_item.cc (revision 29006)
+++ chrome/installer/util/delete_tree_work_item.cc (working copy)
@@ -7,11 +7,11 @@
#include "chrome/installer/util/delete_tree_work_item.h"
DeleteTreeWorkItem::~DeleteTreeWorkItem() {
- std::wstring tmp_dir = file_util::GetDirectoryFromPath(backup_path_);
+ FilePath tmp_dir = backup_path_.DirName();
if (file_util::PathExists(tmp_dir)) {
file_util::Delete(tmp_dir, true);
}
- tmp_dir = file_util::GetDirectoryFromPath(key_backup_path_);
+ tmp_dir = key_backup_path_.DirName();
if (file_util::PathExists(tmp_dir)) {
file_util::Delete(tmp_dir, true);
}
@@ -30,8 +30,8 @@
if (!GetBackupPath(key_path_, &key_backup_path_) ||
!file_util::CopyDirectory(key_path_, key_backup_path_, true) ||
!file_util::Delete(key_path_, true)) {
- LOG(ERROR) << "can not delete " << key_path_
- << " OR copy it to backup path " << key_backup_path_;
+ LOG(ERROR) << "can not delete " << key_path_.value()
+ << " OR copy it to backup path " << key_backup_path_.value();
return false;
}
}
@@ -40,8 +40,8 @@
if (!GetBackupPath(root_path_, &backup_path_) ||
!file_util::CopyDirectory(root_path_, backup_path_, true) ||
!file_util::Delete(root_path_, true)) {
- LOG(ERROR) << "can not delete " << root_path_
- << " OR copy it to backup path " << backup_path_;
+ LOG(ERROR) << "can not delete " << root_path_.value()
+ << " OR copy it to backup path " << backup_path_.value();
return false;
}
}
@@ -58,15 +58,14 @@
}
}
-bool DeleteTreeWorkItem::GetBackupPath(const std::wstring& for_path,
- std::wstring* backup_path) {
+bool DeleteTreeWorkItem::GetBackupPath(const FilePath& for_path,
+ FilePath* backup_path) {
if (!file_util::CreateNewTempDirectory(L"", backup_path)) {
// We assume that CreateNewTempDirectory() is doing its job well.
LOG(ERROR) << "Couldn't get backup path for delete.";
return false;
}
- std::wstring file_name = file_util::GetFilenameFromPath(for_path);
- file_util::AppendToPath(backup_path, file_name);
+ *backup_path = backup_path->Append(for_path.BaseName());
return true;
}
« no previous file with comments | « chrome/installer/util/delete_tree_work_item.h ('k') | chrome/installer/util/move_tree_work_item.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698