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

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

Issue 2379543002: installer and some misc files: Change ScopedTempDir::path() to GetPath() (Closed)
Patch Set: regroup ifs Created 4 years, 3 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/copy_tree_work_item.h ('k') | chrome/installer/util/copy_tree_work_item_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/installer/util/copy_tree_work_item.cc
diff --git a/chrome/installer/util/copy_tree_work_item.cc b/chrome/installer/util/copy_tree_work_item.cc
index 156d7977449af23b14b0de6c166b7a8c635f6133..eb9e342bd7dcfa82c280c8226d94670ce2dcc604 100644
--- a/chrome/installer/util/copy_tree_work_item.cc
+++ b/chrome/installer/util/copy_tree_work_item.cc
@@ -25,8 +25,8 @@ CopyTreeWorkItem::CopyTreeWorkItem(const base::FilePath& source_path,
alternative_path_(alternative_path),
copied_to_dest_path_(false),
moved_to_backup_(false),
- copied_to_alternate_path_(false) {
-}
+ copied_to_alternate_path_(false),
+ backup_path_created_(false) {}
bool CopyTreeWorkItem::DoImpl() {
if (!base::PathExists(source_path_)) {
@@ -76,8 +76,10 @@ bool CopyTreeWorkItem::DoImpl() {
<< temp_dir_.value();
return false;
}
+ backup_path_created_ = true;
- base::FilePath backup = backup_path_.path().Append(dest_path_.BaseName());
+ base::FilePath backup =
+ backup_path_.GetPath().Append(dest_path_.BaseName());
if (base::Move(dest_path_, backup)) {
moved_to_backup_ = true;
VLOG(1) << "Moved destination " << dest_path_.value() <<
@@ -113,7 +115,7 @@ void CopyTreeWorkItem::RollbackImpl() {
LOG(ERROR) << "Can not delete " << dest_path_.value();
}
if (moved_to_backup_) {
- base::FilePath backup(backup_path_.path().Append(dest_path_.BaseName()));
+ base::FilePath backup(backup_path_.GetPath().Append(dest_path_.BaseName()));
if (!base::Move(backup, dest_path_)) {
PLOG(ERROR) << "failed move " << backup.value()
<< " to " << dest_path_.value();
« no previous file with comments | « chrome/installer/util/copy_tree_work_item.h ('k') | chrome/installer/util/copy_tree_work_item_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698