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

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

Issue 216923006: Add a component updater for the CLD2 data file. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix windows file path literals, change android flags back to normal Created 6 years, 8 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
Index: chrome/browser/component_updater/component_unpacker.cc
diff --git a/chrome/browser/component_updater/component_unpacker.cc b/chrome/browser/component_updater/component_unpacker.cc
index 49aafacd0e1bfe7deea5c6dbd441b6d73610a126..48c584cd42f7572f096d581acf706bc083979553 100644
--- a/chrome/browser/component_updater/component_unpacker.cc
+++ b/chrome/browser/component_updater/component_unpacker.cc
@@ -143,6 +143,7 @@ void ComponentUnpacker::Unpack(const Callback& callback) {
}
bool ComponentUnpacker::Verify() {
+ VLOG(1) << "Verifying component: " << path_.value();
if (pk_hash_.empty() || path_.empty()) {
error_ = kInvalidParams;
return false;
@@ -171,23 +172,29 @@ bool ComponentUnpacker::Verify() {
sha256->Finish(hash, arraysize(hash));
if (!std::equal(pk_hash_.begin(), pk_hash_.end(), hash)) {
+ VLOG(1) << "Hash mismatch: " << path_.value();
error_ = kInvalidId;
return false;
}
+ VLOG(1) << "Verification successful: " << path_.value();
return true;
}
bool ComponentUnpacker::Unzip() {
base::FilePath& destination = is_delta_ ? unpack_diff_path_ : unpack_path_;
+ VLOG(1) << "Unpacking in: " << destination.value();
if (!base::CreateNewTempDirectory(base::FilePath::StringType(),
&destination)) {
+ VLOG(1) << "Unable to create temporary directory for unpacking.";
error_ = kUnzipPathError;
return false;
}
if (!zip::Unzip(path_, destination)) {
+ VLOG(1) << "Unzipping failed.";
error_ = kUnzipFailed;
return false;
}
+ VLOG(1) << "Unpacked successfully";
return true;
}

Powered by Google App Engine
This is Rietveld 408576698