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

Unified Diff: chrome/browser/chrome_elf_init_win.cc

Issue 444543002: Add export to query for blacklisted-ness. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Pre-review cleanup. Created 6 years, 4 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/chrome_elf_init_win.cc
diff --git a/chrome/browser/chrome_elf_init_win.cc b/chrome/browser/chrome_elf_init_win.cc
index ce9d3e7235b54f985fadfe9b2a844c762832f895..7f83df809c561eaaceb75af0be6499d201ae7cd2 100644
--- a/chrome/browser/chrome_elf_init_win.cc
+++ b/chrome/browser/chrome_elf_init_win.cc
@@ -3,12 +3,16 @@
// found in the LICENSE file.
#include "base/bind.h"
+#include "base/files/file_path.h"
#include "base/metrics/field_trial.h"
#include "base/metrics/histogram.h"
#include "base/metrics/sparse_histogram.h"
+#include "base/strings/string_util.h"
#include "base/strings/utf_string_conversions.h"
#include "base/win/registry.h"
#include "chrome/browser/chrome_elf_init_win.h"
+#include "chrome/browser/install_verification/win/module_info.h"
+#include "chrome/browser/install_verification/win/module_verification_common.h"
#include "chrome_elf/blacklist/blacklist.h"
#include "chrome_elf/chrome_elf_constants.h"
#include "chrome_elf/dll_hash/dll_hash.h"
@@ -204,3 +208,25 @@ void BrowserBlacklistBeaconSetup() {
RecordBlacklistSetupEvent(BLACKLIST_SETUP_ENABLED);
}
}
+
+bool RetrieveBlacklistedModules(std::vector<base::string16>* module_names) {
csharp 2014/08/05 21:08:59 std::vector<base::string16>* -> const std::vector<
robertshield 2014/08/06 16:38:32 As discussed, this is an out param and there's not
+ DCHECK(module_names);
+
+ bool module_found = false;
+ std::set<ModuleInfo> module_info;
+ if (GetLoadedModules(&module_info)) {
csharp 2014/08/05 21:08:59 Maybe have "if (!GetLoadedModules(&module_info)) r
robertshield 2014/08/06 16:38:32 Done.
+ std::set<ModuleInfo>::const_iterator module_iter(module_info.begin());
+ for (; module_iter != module_info.end(); ++module_iter) {
+ base::string16 module_file_name(StringToLowerASCII(
+ base::FilePath(module_iter->name).BaseName().value()));
+ int blacklist_index =
+ blacklist::GetBlacklistIndex(module_file_name.c_str());
csharp 2014/08/05 21:08:59 Maybe just move this directly into the if statemen
robertshield 2014/08/06 16:38:32 Done.
+ if (blacklist_index > -1) {
csharp 2014/08/05 21:08:59 why > and not !=?
robertshield 2014/08/06 16:38:32 Done.
+ module_names->push_back(module_iter->name);
+ module_found = true;
+ }
+ }
+ }
+
+ return module_found;
+}

Powered by Google App Engine
This is Rietveld 408576698