Index: chrome/browser/safe_browsing/environment_data_collection_win.cc |
diff --git a/chrome/browser/safe_browsing/environment_data_collection_win.cc b/chrome/browser/safe_browsing/environment_data_collection_win.cc |
index b07ad4f2b3c233e76184118fdc0e24d0f0b35175..1d3555dd96ecd412170a8ceec5309d1361994abf 100644 |
--- a/chrome/browser/safe_browsing/environment_data_collection_win.cc |
+++ b/chrome/browser/safe_browsing/environment_data_collection_win.cc |
@@ -10,11 +10,13 @@ |
#include "base/strings/string16.h" |
#include "base/strings/string_util.h" |
#include "base/strings/utf_string_conversions.h" |
+#include "base/win/registry.h" |
#include "chrome/browser/install_verification/win/module_info.h" |
#include "chrome/browser/install_verification/win/module_verification_common.h" |
#include "chrome/browser/net/service_providers_win.h" |
#include "chrome/browser/safe_browsing/path_sanitizer.h" |
#include "chrome/common/safe_browsing/csd.pb.h" |
+#include "chrome_elf/chrome_elf_constants.h" |
namespace safe_browsing { |
@@ -88,10 +90,35 @@ void RecordLspFeature(ClientIncidentReport_EnvironmentData_Process* process) { |
} |
} |
+void CollectDllBlacklistData( |
+ ClientIncidentReport_EnvironmentData_Process* process) { |
+ base::win::RegKey finch_blacklist_reigstry_key( |
grt (UTC plus 2)
2014/06/19 20:06:59
i think this function can be simplified to:
{
Pa
krstnmnlsn
2014/06/19 22:13:15
wow, I didn't know that existed. that's much nicer
|
+ HKEY_CURRENT_USER, blacklist::kRegistryFinchListPath, KEY_QUERY_VALUE); |
+ |
+ if (!finch_blacklist_reigstry_key.Valid()) |
+ return; |
+ |
+ std::wstring name; |
+ std::wstring value; |
+ PathSanitizer path_sanitizer; |
+ int value_count = finch_blacklist_reigstry_key.GetValueCount(); |
+ |
+ for (int i = 0; i < value_count; ++i) { |
+ finch_blacklist_reigstry_key.GetValueNameAt(i, &name); |
+ finch_blacklist_reigstry_key.ReadValue(name.c_str(), &value); |
+ |
+ base::FilePath dll_name(value); |
+ path_sanitizer.StripHomeDirectory(&dll_name); |
+ process->add_blacklisted_dll(dll_name.AsUTF8Unsafe()); |
+ } |
+} |
+ |
void CollectPlatformProcessData( |
ClientIncidentReport_EnvironmentData_Process* process) { |
CollectDlls(process); |
RecordLspFeature(process); |
+ |
grt (UTC plus 2)
2014/06/19 20:06:59
nit: remove newline
krstnmnlsn
2014/06/19 22:13:15
Done.
|
+ CollectDllBlacklistData(process); |
} |
} // namespace safe_browsing |