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

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 unittest build for windows. 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..ee47c897b210381c2038016931a1a7933b6dedec 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),
+ : info(file),
file_ownership_passed(file_ownership_passed),
- request_ids(request_ids) {}
+ request_ids(request_ids) {
+}
ExtensionUpdater::FetchedCRXFile::FetchedCRXFile()
- : path(), file_ownership_passed(true) {}
+ : 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
@@ -682,14 +681,13 @@ void ExtensionUpdater::MaybeInstallCRXFile() {
while (!fetched_crx_files_.empty() && !crx_install_is_running_) {
const FetchedCRXFile& crx_file = fetched_crx_files_.top();
- VLOG(2) << "updating " << crx_file.extension_id
- << " with " << crx_file.path.value();
+ VLOG(2) << "updating " << crx_file.info.extension_id
+ << " with " << crx_file.info.path.value();
// The ExtensionService is now responsible for cleaning up the temp file
- // at |crx_file.path|.
+ // at |crx_file.info.path|.
CrxInstaller* installer = NULL;
- if (service_->UpdateExtension(crx_file.extension_id,
- crx_file.path,
+ if (service_->UpdateExtension(crx_file.info,
crx_file.file_ownership_passed,
&installer)) {
crx_install_is_running_ = true;
@@ -713,7 +711,7 @@ void ExtensionUpdater::MaybeInstallCRXFile() {
for (std::set<int>::const_iterator it = crx_file.request_ids.begin();
it != crx_file.request_ids.end(); ++it) {
InProgressCheck& request = requests_in_progress_[*it];
- request.in_progress_ids_.remove(crx_file.extension_id);
+ request.in_progress_ids_.remove(crx_file.info.extension_id);
}
request_ids.insert(crx_file.request_ids.begin(),
crx_file.request_ids.end());
@@ -739,7 +737,7 @@ void ExtensionUpdater::Observe(int type,
for (std::set<int>::const_iterator it = crx_file.request_ids.begin();
it != crx_file.request_ids.end(); ++it) {
InProgressCheck& request = requests_in_progress_[*it];
- request.in_progress_ids_.remove(crx_file.extension_id);
+ request.in_progress_ids_.remove(crx_file.info.extension_id);
NotifyIfFinished(*it);
}
« no previous file with comments | « chrome/browser/extensions/updater/extension_updater.h ('k') | chrome/browser/extensions/updater/extension_updater_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698