Commit 8be6d702 authored by waffles@chromium.org's avatar waffles@chromium.org

Don't fail component registration if the component on disk is corrupt.

BUG=399806

Review URL: https://codereview.chromium.org/434183002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@287636 0039d316-1c4b-4281-b951-d872f2087c98
parent e3b76fa9
...@@ -164,17 +164,20 @@ void DefaultComponentInstaller::StartRegistration(ComponentUpdateService* cus) { ...@@ -164,17 +164,20 @@ void DefaultComponentInstaller::StartRegistration(ComponentUpdateService* cus) {
} }
if (found) { if (found) {
current_version_ = latest_version;
// TODO(ddorwin): Remove these members and pass them directly to
// FinishRegistration().
base::ReadFileToString(latest_dir.AppendASCII("manifest.fingerprint"),
&current_fingerprint_);
current_manifest_ = ReadManifest(latest_dir); current_manifest_ = ReadManifest(latest_dir);
if (!current_manifest_) { if (current_manifest_) {
current_version_ = latest_version;
// TODO(ddorwin): Remove these members and pass them directly to
// FinishRegistration().
base::ReadFileToString(latest_dir.AppendASCII("manifest.fingerprint"),
&current_fingerprint_);
} else {
// If the manifest can't be read, mark the directory for deletion and
// continue as if there were no versioned directories at all.
DLOG(ERROR) << "Failed to read manifest for " DLOG(ERROR) << "Failed to read manifest for "
<< installer_traits_->GetName() << " (" << installer_traits_->GetName() << " ("
<< base_dir.MaybeAsASCII() << ")."; << base_dir.MaybeAsASCII() << ").";
return; older_dirs.push_back(latest_dir);
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment