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

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

Issue 1882923003: Add best-effort/allow rollback flags on WorkItem. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@simple_list_tests
Patch Set: Created 4 years, 8 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
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 #include "chrome/installer/setup/setup_main.h" 5 #include "chrome/installer/setup/setup_main.h"
6 6
7 #include <windows.h> 7 #include <windows.h>
8 #include <msi.h> 8 #include <msi.h>
9 #include <shellapi.h> 9 #include <shellapi.h>
10 #include <shlobj.h> 10 #include <shlobj.h>
(...skipping 409 matching lines...) Expand 10 before | Expand all | Expand 10 after
420 reg_root, 420 reg_root,
421 version_key, 421 version_key,
422 KEY_WOW64_32KEY, 422 KEY_WOW64_32KEY,
423 google_update::kRegCriticalVersionField); 423 google_update::kRegCriticalVersionField);
424 install_list->AddDeleteRegValueWorkItem(reg_root, 424 install_list->AddDeleteRegValueWorkItem(reg_root,
425 version_key, 425 version_key,
426 KEY_WOW64_32KEY, 426 KEY_WOW64_32KEY,
427 google_update::kRegRenameCmdField); 427 google_update::kRegRenameCmdField);
428 } 428 }
429 // old_chrome.exe is still in use in most cases, so ignore failures here. 429 // old_chrome.exe is still in use in most cases, so ignore failures here.
430 // Make sure this is the last item in the list because it cannot be rolled 430 install_list->AddDeleteTreeWorkItem(chrome_old_exe, temp_path.path())
431 // back. 431 ->set_best_effort(true);
432 install_list->AddDeleteTreeWorkItem(chrome_old_exe, temp_path.path())->
433 set_ignore_failure(true);
434 432
435 installer::InstallStatus ret = installer::RENAME_SUCCESSFUL; 433 installer::InstallStatus ret = installer::RENAME_SUCCESSFUL;
436 if (!install_list->Do()) { 434 if (!install_list->Do()) {
437 LOG(ERROR) << "Renaming of executables failed. Rolling back any changes."; 435 LOG(ERROR) << "Renaming of executables failed. Rolling back any changes.";
438 install_list->Rollback(); 436 install_list->Rollback();
439 ret = installer::RENAME_FAILED; 437 ret = installer::RENAME_FAILED;
440 } 438 }
441 // temp_path's dtor will take care of deleting or scheduling itself for 439 // temp_path's dtor will take care of deleting or scheduling itself for
442 // deletion at reboot when this scope closes. 440 // deletion at reboot when this scope closes.
443 VLOG(1) << "Deleting temporary directory " << temp_path.path().value(); 441 VLOG(1) << "Deleting temporary directory " << temp_path.path().value();
(...skipping 1403 matching lines...) Expand 10 before | Expand all | Expand 10 after
1847 // to pass through, since this is only returned on uninstall which is 1845 // to pass through, since this is only returned on uninstall which is
1848 // never invoked directly by Google Update. 1846 // never invoked directly by Google Update.
1849 return_code = InstallUtil::GetInstallReturnCode(install_status); 1847 return_code = InstallUtil::GetInstallReturnCode(install_status);
1850 } 1848 }
1851 1849
1852 installer::EndPersistentHistogramStorage(installer_state.target_path()); 1850 installer::EndPersistentHistogramStorage(installer_state.target_path());
1853 VLOG(1) << "Installation complete, returning: " << return_code; 1851 VLOG(1) << "Installation complete, returning: " << return_code;
1854 1852
1855 return return_code; 1853 return return_code;
1856 } 1854 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698