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

Unified Diff: chrome/browser/extensions/extension_service.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, 10 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/extension_service.cc
diff --git a/chrome/browser/extensions/extension_service.cc b/chrome/browser/extensions/extension_service.cc
index 53d907bdea0a0b73b68cfd1b1c42553fc75b9a17..94e4b52f31bbeb0dfbed429d87bdb733fdd389fe 100644
--- a/chrome/browser/extensions/extension_service.cc
+++ b/chrome/browser/extensions/extension_service.cc
@@ -474,8 +474,7 @@ void ExtensionService::LoadGreylistFromPrefs() {
}
}
-bool ExtensionService::UpdateExtension(const std::string& id,
- const base::FilePath& extension_path,
+bool ExtensionService::UpdateExtension(const extensions::CRXFileInfo& file,
bool file_ownership_passed,
CrxInstaller** out_crx_installer) {
CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
@@ -487,6 +486,8 @@ bool ExtensionService::UpdateExtension(const std::string& id,
return false;
}
+ const std::string& id = file.extension_id;
+
const extensions::PendingExtensionInfo* pending_extension_info =
pending_extension_manager()->GetById(id);
@@ -498,8 +499,7 @@ bool ExtensionService::UpdateExtension(const std::string& id,
// that would do it for us.
if (!GetFileTaskRunner()->PostTask(
FROM_HERE,
- base::Bind(
- &extensions::file_util::DeleteFile, extension_path, false)))
+ base::Bind(&extensions::file_util::DeleteFile, file.path, false)))
NOTREACHED();
return false;
@@ -557,7 +557,7 @@ bool ExtensionService::UpdateExtension(const std::string& id,
installer->set_delete_source(file_ownership_passed);
installer->set_install_cause(extension_misc::INSTALL_CAUSE_UPDATE);
- installer->InstallCrx(extension_path);
+ installer->InstallCrxFile(file);
if (out_crx_installer)
*out_crx_installer = installer.get();
« no previous file with comments | « chrome/browser/extensions/extension_service.h ('k') | chrome/browser/extensions/extension_service_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698