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

Side by Side Diff: chrome/installer/setup/uninstall.cc

Issue 18383003: Move DeleteAfterReboot and Move to base namespace (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 5 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 // 4 //
5 // This file defines the methods useful for uninstalling Chrome. 5 // This file defines the methods useful for uninstalling Chrome.
6 6
7 #include "chrome/installer/setup/uninstall.h" 7 #include "chrome/installer/setup/uninstall.h"
8 8
9 #include <windows.h> 9 #include <windows.h>
10 10
(...skipping 477 matching lines...) Expand 10 before | Expand all | Expand 10 after
488 if (!PathService::Get(base::DIR_TEMP, &tmp_dir)) { 488 if (!PathService::Get(base::DIR_TEMP, &tmp_dir)) {
489 NOTREACHED(); 489 NOTREACHED();
490 } else if (!file_util::CreateTemporaryFileInDir(tmp_dir, &temp_file)) { 490 } else if (!file_util::CreateTemporaryFileInDir(tmp_dir, &temp_file)) {
491 LOG(ERROR) << "Failed to create temporary file for setup.exe."; 491 LOG(ERROR) << "Failed to create temporary file for setup.exe.";
492 } else { 492 } else {
493 VLOG(1) << "Changing current directory to: " << tmp_dir.value(); 493 VLOG(1) << "Changing current directory to: " << tmp_dir.value();
494 if (!file_util::SetCurrentDirectory(tmp_dir)) 494 if (!file_util::SetCurrentDirectory(tmp_dir))
495 PLOG(ERROR) << "Failed to change the current directory."; 495 PLOG(ERROR) << "Failed to change the current directory.";
496 496
497 VLOG(1) << "Attempting to move setup to: " << temp_file.value(); 497 VLOG(1) << "Attempting to move setup to: " << temp_file.value();
498 ret = file_util::Move(setup_exe, temp_file); 498 ret = base::Move(setup_exe, temp_file);
499 PLOG_IF(ERROR, !ret) << "Failed to move setup to " << temp_file.value(); 499 PLOG_IF(ERROR, !ret) << "Failed to move setup to " << temp_file.value();
500 500
501 // We cannot delete the file right away, but try to delete it some other 501 // We cannot delete the file right away, but try to delete it some other
502 // way. Either with the help of a different process or the system. 502 // way. Either with the help of a different process or the system.
503 if (ret && !file_util::DeleteAfterReboot(temp_file)) { 503 if (ret && !base::DeleteAfterReboot(temp_file)) {
504 static const uint32 kDeleteAfterMs = 10 * 1000; 504 static const uint32 kDeleteAfterMs = 10 * 1000;
505 installer::DeleteFileFromTempProcess(temp_file, kDeleteAfterMs); 505 installer::DeleteFileFromTempProcess(temp_file, kDeleteAfterMs);
506 } 506 }
507 } 507 }
508 return ret; 508 return ret;
509 } 509 }
510 510
511 DeleteResult DeleteApplicationProductAndVendorDirectories( 511 DeleteResult DeleteApplicationProductAndVendorDirectories(
512 const base::FilePath& application_directory) { 512 const base::FilePath& application_directory) {
513 DeleteResult result(DeleteEmptyDir(application_directory)); 513 DeleteResult result(DeleteEmptyDir(application_directory));
(...skipping 912 matching lines...) Expand 10 before | Expand all | Expand 10 after
1426 // deletion unconditionally. If they are not empty, the session manager 1426 // deletion unconditionally. If they are not empty, the session manager
1427 // will not delete them on reboot. 1427 // will not delete them on reboot.
1428 ScheduleParentAndGrandparentForDeletion(target_path); 1428 ScheduleParentAndGrandparentForDeletion(target_path);
1429 } else if (DeleteApplicationProductAndVendorDirectories(target_path) == 1429 } else if (DeleteApplicationProductAndVendorDirectories(target_path) ==
1430 installer::DELETE_FAILED) { 1430 installer::DELETE_FAILED) {
1431 *uninstall_status = installer::UNINSTALL_FAILED; 1431 *uninstall_status = installer::UNINSTALL_FAILED;
1432 } 1432 }
1433 } 1433 }
1434 1434
1435 } // namespace installer 1435 } // namespace installer
OLDNEW
« no previous file with comments | « chrome/common/service_process_util_unittest.cc ('k') | chrome/installer/test/alternate_version_generator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698