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

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

Issue 893703004: Rewriting patch logic without the comma operator. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixing indentation as per code-review. Created 5 years, 10 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 152 matching lines...) Expand 10 before | Expand all | Expand 10 after
163 LOG(ERROR) << "Failed to find archive to patch."; 163 LOG(ERROR) << "Failed to find archive to patch.";
164 *install_status = installer::DIFF_PATCH_SOURCE_MISSING; 164 *install_status = installer::DIFF_PATCH_SOURCE_MISSING;
165 installer_state.WriteInstallerResult(*install_status, 165 installer_state.WriteInstallerResult(*install_status,
166 IDS_INSTALL_UNCOMPRESSION_FAILED_BASE, 166 IDS_INSTALL_UNCOMPRESSION_FAILED_BASE,
167 NULL); 167 NULL);
168 return false; 168 return false;
169 } 169 }
170 archive_helper->set_patch_source(patch_source); 170 archive_helper->set_patch_source(patch_source);
171 171
172 // Try courgette first. Failing that, try bspatch. 172 // Try courgette first. Failing that, try bspatch.
173 if ((installer_state.UpdateStage(installer::ENSEMBLE_PATCHING), 173 installer_state.UpdateStage(installer::ENSEMBLE_PATCHING);
174 !archive_helper->EnsemblePatch()) && 174 if (!archive_helper->EnsemblePatch()) {
175 (installer_state.UpdateStage(installer::BINARY_PATCHING), 175 installer_state.UpdateStage(installer::BINARY_PATCHING);
176 !archive_helper->BinaryPatch())) { 176 if (!archive_helper->BinaryPatch()) {
177 *install_status = installer::APPLY_DIFF_PATCH_FAILED; 177 *install_status = installer::APPLY_DIFF_PATCH_FAILED;
178 installer_state.WriteInstallerResult(*install_status, 178 installer_state.WriteInstallerResult(
179 IDS_INSTALL_UNCOMPRESSION_FAILED_BASE, 179 *install_status, IDS_INSTALL_UNCOMPRESSION_FAILED_BASE, NULL);
180 NULL); 180 return false;
181 return false; 181 }
182 } 182 }
183 183
184 *archive_type = installer::INCREMENTAL_ARCHIVE_TYPE; 184 *archive_type = installer::INCREMENTAL_ARCHIVE_TYPE;
185 return true; 185 return true;
186 } 186 }
187 187
188 // In multi-install, adds all products to |installer_state| that are 188 // In multi-install, adds all products to |installer_state| that are
189 // multi-installed and must be updated along with the products already present 189 // multi-installed and must be updated along with the products already present
190 // in |installer_state|. 190 // in |installer_state|.
191 void AddExistingMultiInstalls(const InstallationState& original_state, 191 void AddExistingMultiInstalls(const InstallationState& original_state,
(...skipping 1498 matching lines...) Expand 10 before | Expand all | Expand 10 after
1690 // Note that we allow the status installer::UNINSTALL_REQUIRES_REBOOT 1690 // Note that we allow the status installer::UNINSTALL_REQUIRES_REBOOT
1691 // to pass through, since this is only returned on uninstall which is 1691 // to pass through, since this is only returned on uninstall which is
1692 // never invoked directly by Google Update. 1692 // never invoked directly by Google Update.
1693 return_code = InstallUtil::GetInstallReturnCode(install_status); 1693 return_code = InstallUtil::GetInstallReturnCode(install_status);
1694 } 1694 }
1695 1695
1696 VLOG(1) << "Installation complete, returning: " << return_code; 1696 VLOG(1) << "Installation complete, returning: " << return_code;
1697 1697
1698 return return_code; 1698 return return_code;
1699 } 1699 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698