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

Unified Diff: chrome/browser/extensions/updater/extension_updater.cc

Issue 829583002: Validate hash_sha256 checksum on .crx update. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix unit tests. Created 5 years, 11 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/extensions/updater/extension_updater.cc
diff --git a/chrome/browser/extensions/updater/extension_updater.cc b/chrome/browser/extensions/updater/extension_updater.cc
index 0a373a964284bd2a8b869dbecee017d491c3382b..6be01d33eb76320f9e0a089e0a720d76ed4a6110 100644
--- a/chrome/browser/extensions/updater/extension_updater.cc
+++ b/chrome/browser/extensions/updater/extension_updater.cc
@@ -189,17 +189,17 @@ ExtensionUpdater::CheckParams::CheckParams()
ExtensionUpdater::CheckParams::~CheckParams() {}
ExtensionUpdater::FetchedCRXFile::FetchedCRXFile(
- const std::string& i,
- const base::FilePath& p,
+ const CRXFileInfo& file,
bool file_ownership_passed,
const std::set<int>& request_ids)
- : extension_id(i),
- path(p),
+ : CRXFileInfo(file),
asargent_no_longer_on_chrome 2015/02/03 00:42:55 As FYI, if we were to continue inheritance instead
file_ownership_passed(file_ownership_passed),
- request_ids(request_ids) {}
+ request_ids(request_ids) {
+}
ExtensionUpdater::FetchedCRXFile::FetchedCRXFile()
- : path(), file_ownership_passed(true) {}
+ : CRXFileInfo(), file_ownership_passed(true) {
+}
ExtensionUpdater::FetchedCRXFile::~FetchedCRXFile() {}
@@ -591,19 +591,18 @@ void ExtensionUpdater::OnExtensionDownloadFailed(
}
void ExtensionUpdater::OnExtensionDownloadFinished(
- const std::string& id,
- const base::FilePath& path,
+ const CRXFileInfo& file,
bool file_ownership_passed,
const GURL& download_url,
const std::string& version,
const PingResult& ping,
const std::set<int>& request_ids) {
DCHECK(alive_);
- UpdatePingData(id, ping);
+ UpdatePingData(file.extension_id, ping);
- VLOG(2) << download_url << " written to " << path.value();
+ VLOG(2) << download_url << " written to " << file.path.value();
- FetchedCRXFile fetched(id, path, file_ownership_passed, request_ids);
+ FetchedCRXFile fetched(file, file_ownership_passed, request_ids);
fetched_crx_files_.push(fetched);
// MaybeInstallCRXFile() removes extensions from |in_progress_ids_| after
@@ -688,9 +687,7 @@ void ExtensionUpdater::MaybeInstallCRXFile() {
// The ExtensionService is now responsible for cleaning up the temp file
// at |crx_file.path|.
CrxInstaller* installer = NULL;
- if (service_->UpdateExtension(crx_file.extension_id,
- crx_file.path,
- crx_file.file_ownership_passed,
+ if (service_->UpdateExtension(crx_file, crx_file.file_ownership_passed,
&installer)) {
crx_install_is_running_ = true;
current_crx_file_ = crx_file;

Powered by Google App Engine
This is Rietveld 408576698