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

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: Chris' feedback. 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
« no previous file with comments | « chrome/browser/chrome_elf_init_win.h ('k') | chrome/chrome_tests_unit.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..af333fe0d05e3eeae97aeb32cd634d801d83fd8a 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,24 @@ void BrowserBlacklistBeaconSetup() {
RecordBlacklistSetupEvent(BLACKLIST_SETUP_ENABLED);
}
}
+
+bool GetLoadedBlacklistedModules(std::vector<base::string16>* module_names) {
+ DCHECK(module_names);
+
+ std::set<ModuleInfo> module_info;
csharp 2014/08/06 17:52:57 nit: module_info -> module_info_set
robertshield 2014/08/06 17:54:49 Done.
+ if (!GetLoadedModules(&module_info))
+ return false;
+
+ bool module_found = false;
+ 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()));
+ if (blacklist::GetBlacklistIndex(module_file_name.c_str()) != -1) {
+ module_names->push_back(module_iter->name);
+ module_found = true;
+ }
+ }
+
+ return module_found;
csharp 2014/08/06 17:52:57 I think we should return True here and only return
robertshield 2014/08/06 17:54:49 Done.
+}
« no previous file with comments | « chrome/browser/chrome_elf_init_win.h ('k') | chrome/chrome_tests_unit.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698