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

Unified Diff: extensions/utility/utility_handler.cc

Issue 2321823002: Exclude exe files while unzipping CRXes (Closed)
Patch Set: Ignore case Created 4 years, 3 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 | « extensions/utility/unpacker_unittest.cc ('k') | third_party/zlib/google/zip.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/utility/utility_handler.cc
diff --git a/extensions/utility/utility_handler.cc b/extensions/utility/utility_handler.cc
index 4f4ce471204c81081cf4179185bc2e557c82112f..7d6af35336910cc671080c541ff768d494c139a0 100644
--- a/extensions/utility/utility_handler.cc
+++ b/extensions/utility/utility_handler.cc
@@ -81,7 +81,11 @@ void UtilityHandler::OnParseUpdateManifest(const std::string& xml) {
void UtilityHandler::OnUnzipToDir(const base::FilePath& zip_path,
const base::FilePath& dir) {
- if (!zip::Unzip(zip_path, dir)) {
+ const base::Callback<bool(const base::FilePath&)>& filter_cb =
+ base::Bind(&Unpacker::ShouldExtractFile);
+ // TODO(crbug.com/645263): This silently ignores blocked file types.
+ // Add install warnings.
+ if (!zip::UnzipWithFilterCallback(zip_path, dir, filter_cb)) {
Send(new ExtensionUtilityHostMsg_UnzipToDir_Failed(
std::string(kExtensionHandlerUnzipError)));
} else {
« no previous file with comments | « extensions/utility/unpacker_unittest.cc ('k') | third_party/zlib/google/zip.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698