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

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: fix build error Created 4 years, 7 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 412 matching lines...) Expand 10 before | Expand all | Expand 10 after
423 reg_root, 423 reg_root,
424 version_key, 424 version_key,
425 KEY_WOW64_32KEY, 425 KEY_WOW64_32KEY,
426 google_update::kRegCriticalVersionField); 426 google_update::kRegCriticalVersionField);
427 install_list->AddDeleteRegValueWorkItem(reg_root, 427 install_list->AddDeleteRegValueWorkItem(reg_root,
428 version_key, 428 version_key,
429 KEY_WOW64_32KEY, 429 KEY_WOW64_32KEY,
430 google_update::kRegRenameCmdField); 430 google_update::kRegRenameCmdField);
431 } 431 }
432 // old_chrome.exe is still in use in most cases, so ignore failures here. 432 // old_chrome.exe is still in use in most cases, so ignore failures here.
433 // Make sure this is the last item in the list because it cannot be rolled 433 install_list->AddDeleteTreeWorkItem(chrome_old_exe, temp_path.path())
434 // back. 434 ->set_best_effort(true);
435 install_list->AddDeleteTreeWorkItem(chrome_old_exe, temp_path.path())->
436 set_ignore_failure(true);
437 435
438 installer::InstallStatus ret = installer::RENAME_SUCCESSFUL; 436 installer::InstallStatus ret = installer::RENAME_SUCCESSFUL;
439 if (!install_list->Do()) { 437 if (!install_list->Do()) {
440 LOG(ERROR) << "Renaming of executables failed. Rolling back any changes."; 438 LOG(ERROR) << "Renaming of executables failed. Rolling back any changes.";
441 install_list->Rollback(); 439 install_list->Rollback();
442 ret = installer::RENAME_FAILED; 440 ret = installer::RENAME_FAILED;
443 } 441 }
444 // temp_path's dtor will take care of deleting or scheduling itself for 442 // temp_path's dtor will take care of deleting or scheduling itself for
445 // deletion at reboot when this scope closes. 443 // deletion at reboot when this scope closes.
446 VLOG(1) << "Deleting temporary directory " << temp_path.path().value(); 444 VLOG(1) << "Deleting temporary directory " << temp_path.path().value();
(...skipping 1416 matching lines...) Expand 10 before | Expand all | Expand 10 after
1863 // to pass through, since this is only returned on uninstall which is 1861 // to pass through, since this is only returned on uninstall which is
1864 // never invoked directly by Google Update. 1862 // never invoked directly by Google Update.
1865 return_code = InstallUtil::GetInstallReturnCode(install_status); 1863 return_code = InstallUtil::GetInstallReturnCode(install_status);
1866 } 1864 }
1867 1865
1868 installer::EndPersistentHistogramStorage(installer_state.target_path()); 1866 installer::EndPersistentHistogramStorage(installer_state.target_path());
1869 VLOG(1) << "Installation complete, returning: " << return_code; 1867 VLOG(1) << "Installation complete, returning: " << return_code;
1870 1868
1871 return return_code; 1869 return return_code;
1872 } 1870 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698