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

Unified Diff: chrome/installer/util/move_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/delete_tree_work_item.cc ('k') | chrome/installer/util/shell_util_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/installer/util/move_tree_work_item.cc
diff --git a/chrome/installer/util/move_tree_work_item.cc b/chrome/installer/util/move_tree_work_item.cc
index ef682348c636a56dcd19f37c7607bc75f1c19547..fa9896eb46310794ff5685a18dace2386770ca0e 100644
--- a/chrome/installer/util/move_tree_work_item.cc
+++ b/chrome/installer/util/move_tree_work_item.cc
@@ -48,7 +48,8 @@ bool MoveTreeWorkItem::DoImpl() {
<< temp_dir_.value();
return false;
}
- base::FilePath backup = backup_path_.path().Append(dest_path_.BaseName());
+ base::FilePath backup =
+ backup_path_.GetPath().Append(dest_path_.BaseName());
if (duplicate_option_ == CHECK_DUPLICATES) {
if (installer::IsIdenticalFileHierarchy(source_path_, dest_path_)) {
@@ -105,14 +106,18 @@ void MoveTreeWorkItem::RollbackImpl() {
<< " to " << source_path_.value();
}
- base::FilePath backup = backup_path_.path().Append(dest_path_.BaseName());
- if (moved_to_backup_ && !base::Move(backup, dest_path_)) {
- PLOG(ERROR) << "failed move " << backup.value()
- << " to " << dest_path_.value();
- }
+ if (moved_to_backup_ || source_moved_to_backup_) {
+ base::FilePath backup =
+ backup_path_.GetPath().Append(dest_path_.BaseName());
- if (source_moved_to_backup_ && !base::Move(backup, source_path_)) {
- PLOG(ERROR) << "Can not restore " << backup.value()
- << " to " << source_path_.value();
+ if (moved_to_backup_ && !base::Move(backup, dest_path_)) {
+ PLOG(ERROR) << "failed move " << backup.value() << " to "
+ << dest_path_.value();
+ }
+
+ if (source_moved_to_backup_ && !base::Move(backup, source_path_)) {
+ PLOG(ERROR) << "Can not restore " << backup.value() << " to "
+ << source_path_.value();
+ }
}
}
« no previous file with comments | « chrome/installer/util/delete_tree_work_item.cc ('k') | chrome/installer/util/shell_util_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698