summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
authortommi@chromium.org <tommi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-04-06 17:42:45 +0000
committertommi@chromium.org <tommi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-04-06 17:42:45 +0000
commit43a9e24a52fa867db98fc2195b8db85b4729e7a1 (patch)
treecad7a14c415542083ac3d1ecc2df1fd86f789557 /chrome
parent6768ac0b06ae36ec7b2d27adfb9b64fc17f57cee (diff)
downloadchromium_src-43a9e24a52fa867db98fc2195b8db85b4729e7a1.zip
chromium_src-43a9e24a52fa867db98fc2195b8db85b4729e7a1.tar.gz
chromium_src-43a9e24a52fa867db98fc2195b8db85b4729e7a1.tar.bz2
Switch out use of std::string and std::vector for large allocations for a buffer class that doesn't throw exceptions.
The new buffer class is pretty simple and relies on the MemoryAllocator class that I previously to back large allocations with mapped files when memory is scarce. That reduced the number of crashes quite a bit but we still crash on machines that are simply out of diskspace as well. So, the right thing to do is to expect and handle failures which is what this cl is all about. What we should see once this has landed is that crash dumps due to courgette running out of disk space should disappear from crash/ and instead we should see the number of users that run into this particular problem in dashboards. TEST=Courgette out-of-memory/out-of-diskspace errors should disappear from crash/ BUG=74777 Review URL: http://codereview.chromium.org/6677141 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@80648 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r--chrome/installer/setup/setup_main.cc3
-rw-r--r--chrome/installer/setup/setup_util.cc11
-rw-r--r--chrome/installer/util/util_constants.h1
3 files changed, 13 insertions, 2 deletions
diff --git a/chrome/installer/setup/setup_main.cc b/chrome/installer/setup/setup_main.cc
index 87cf8a5..15d04e1 100644
--- a/chrome/installer/setup/setup_main.cc
+++ b/chrome/installer/setup/setup_main.cc
@@ -510,7 +510,8 @@ installer::InstallStatus InstallProductsHelper(
FilePath unpack_path(temp_path.path().Append(installer::kInstallSourceDir));
if (UnPackArchive(archive, installer_state, temp_path.path(), unpack_path,
archive_type)) {
- install_status = installer::UNCOMPRESSION_FAILED;
+ install_status = (*archive_type) == installer::INCREMENTAL_ARCHIVE_TYPE ?
+ installer::APPLY_DIFF_PATCH_FAILED : installer::UNCOMPRESSION_FAILED;
InstallUtil::WriteInstallerResult(system_install,
installer_state.state_key(), install_status,
IDS_INSTALL_UNCOMPRESSION_FAILED_BASE, NULL);
diff --git a/chrome/installer/setup/setup_util.cc b/chrome/installer/setup/setup_util.cc
index dbe895c..19b6ce3 100644
--- a/chrome/installer/setup/setup_util.cc
+++ b/chrome/installer/setup/setup_util.cc
@@ -35,7 +35,16 @@ int ApplyDiffPatch(const FilePath& src,
if (patch_status == courgette::C_OK)
return 0;
- VLOG(1) << "Failed to apply patch " << patch.value() << " using courgette.";
+ VLOG(1) << "Failed to apply patch " << patch.value()
+ << " using courgette. err=" << patch_status;
+
+ // If we ran out of memory or disk space, then these are likely the errors
+ // we will see. If we run into them, return an error and stay on the
+ // 'ENSEMBLE_PATCHING' update stage.
+ if (patch_status == courgette::C_DISASSEMBLY_FAILED ||
+ patch_status == courgette::C_STREAM_ERROR) {
+ return MEM_ERROR;
+ }
if (installer_state != NULL)
installer_state->UpdateStage(installer::BINARY_PATCHING);
diff --git a/chrome/installer/util/util_constants.h b/chrome/installer/util/util_constants.h
index c8bcc3d..9153b7b 100644
--- a/chrome/installer/util/util_constants.h
+++ b/chrome/installer/util/util_constants.h
@@ -73,6 +73,7 @@ enum InstallStatus {
READY_MODE_REQUIRES_CHROME, // 40. Chrome Frame in ready-mode requires Chrome
REQUIRES_MULTI_INSTALL, // 41. --multi-install was missing from the
// command line.
+ APPLY_DIFF_PATCH_FAILED, // 42. Failed to apply a diff patch.
};