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

Unified Diff: chrome/browser/component_updater/default_component_installer.cc

Issue 434183002: Don't fail component registration if the component on disk is corrupt. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: switch the happy case to be first Created 6 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/component_updater/default_component_installer.cc
diff --git a/chrome/browser/component_updater/default_component_installer.cc b/chrome/browser/component_updater/default_component_installer.cc
index bc41f9f4ebdda39e96ce9961bc1c22464d534cfe..c951f960ed1136e4dbc78704bfc34e76a0db3acb 100644
--- a/chrome/browser/component_updater/default_component_installer.cc
+++ b/chrome/browser/component_updater/default_component_installer.cc
@@ -164,17 +164,20 @@ void DefaultComponentInstaller::StartRegistration(ComponentUpdateService* cus) {
}
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);
- 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 "
<< installer_traits_->GetName() << " ("
<< base_dir.MaybeAsASCII() << ").";
- return;
+ older_dirs.push_back(latest_dir);
}
}
« 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