| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/safe_browsing/incident_reporting/environment_data_colle
ction_win.h" | 5 #include "chrome/browser/safe_browsing/incident_reporting/environment_data_colle
ction_win.h" |
| 6 | 6 |
| 7 #include <windows.h> | 7 #include <windows.h> |
| 8 #include <set> | 8 #include <set> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 122 base::FilePath dll_name(iter.Value()); | 122 base::FilePath dll_name(iter.Value()); |
| 123 path_sanitizer.StripHomeDirectory(&dll_name); | 123 path_sanitizer.StripHomeDirectory(&dll_name); |
| 124 process->add_blacklisted_dll(dll_name.AsUTF8Unsafe()); | 124 process->add_blacklisted_dll(dll_name.AsUTF8Unsafe()); |
| 125 } | 125 } |
| 126 } | 126 } |
| 127 | 127 |
| 128 void CollectModuleVerificationData( | 128 void CollectModuleVerificationData( |
| 129 const wchar_t* const modules_to_verify[], | 129 const wchar_t* const modules_to_verify[], |
| 130 size_t num_modules_to_verify, | 130 size_t num_modules_to_verify, |
| 131 ClientIncidentReport_EnvironmentData_Process* process) { | 131 ClientIncidentReport_EnvironmentData_Process* process) { |
| 132 #if !defined(_WIN64) |
| 132 for (size_t i = 0; i < num_modules_to_verify; ++i) { | 133 for (size_t i = 0; i < num_modules_to_verify; ++i) { |
| 133 scoped_ptr<ClientIncidentReport_EnvironmentData_Process_ModuleState> | 134 scoped_ptr<ClientIncidentReport_EnvironmentData_Process_ModuleState> |
| 134 module_state( | 135 module_state( |
| 135 new ClientIncidentReport_EnvironmentData_Process_ModuleState()); | 136 new ClientIncidentReport_EnvironmentData_Process_ModuleState()); |
| 136 | 137 |
| 137 VerificationResult result = NewVerifyModule(modules_to_verify[i], | 138 VerificationResult result = NewVerifyModule(modules_to_verify[i], |
| 138 module_state.get()); | 139 module_state.get()); |
| 139 | 140 |
| 140 std::set<std::string> modified_exports; | 141 std::set<std::string> modified_exports; |
| 141 int num_bytes = 0; | 142 int num_bytes = 0; |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 184 module_state->set_modified_state(static_cast< | 185 module_state->set_modified_state(static_cast< |
| 185 ClientIncidentReport_EnvironmentData_Process_ModuleState_ModifiedState>( | 186 ClientIncidentReport_EnvironmentData_Process_ModuleState_ModifiedState>( |
| 186 modified + 1)); | 187 modified + 1)); |
| 187 for (std::set<std::string>::iterator it = modified_exports.begin(); | 188 for (std::set<std::string>::iterator it = modified_exports.begin(); |
| 188 it != modified_exports.end(); | 189 it != modified_exports.end(); |
| 189 ++it) { | 190 ++it) { |
| 190 module_state->add_modified_export(*it); | 191 module_state->add_modified_export(*it); |
| 191 } | 192 } |
| 192 process->mutable_module_state()->AddAllocated(module_state.release()); | 193 process->mutable_module_state()->AddAllocated(module_state.release()); |
| 193 } | 194 } |
| 195 #endif // _WIN64 |
| 194 } | 196 } |
| 195 | 197 |
| 196 void CollectPlatformProcessData( | 198 void CollectPlatformProcessData( |
| 197 ClientIncidentReport_EnvironmentData_Process* process) { | 199 ClientIncidentReport_EnvironmentData_Process* process) { |
| 198 CollectDlls(process); | 200 CollectDlls(process); |
| 199 RecordLspFeature(process); | 201 RecordLspFeature(process); |
| 200 CollectDllBlacklistData(process); | 202 CollectDllBlacklistData(process); |
| 201 CollectModuleVerificationData( | 203 CollectModuleVerificationData( |
| 202 kModulesToVerify, arraysize(kModulesToVerify), process); | 204 kModulesToVerify, arraysize(kModulesToVerify), process); |
| 203 } | 205 } |
| 204 | 206 |
| 205 } // namespace safe_browsing | 207 } // namespace safe_browsing |
| OLD | NEW |