Refactor WebsiteSettings to operate on a SecurityInfo
[chromium-blink-merge.git] / chrome / browser / safe_browsing / incident_reporting / environment_data_collection_win.h
blob4dacce3927d364c80f6784c83a3a8beab377d041
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
3 // found in the LICENSE file.
5 #ifndef CHROME_BROWSER_SAFE_BROWSING_INCIDENT_REPORTING_ENVIRONMENT_DATA_COLLECTION_WIN_H_
6 #define CHROME_BROWSER_SAFE_BROWSING_INCIDENT_REPORTING_ENVIRONMENT_DATA_COLLECTION_WIN_H_
8 #include <windows.h>
10 namespace google {
11 namespace protobuf {
12 template <typename T>
13 class RepeatedPtrField;
17 namespace safe_browsing {
19 class ClientIncidentReport_EnvironmentData_OS_RegistryKey;
20 class ClientIncidentReport_EnvironmentData_Process;
22 // Datatype for storing information about the registry keys from which to
23 // collect data.
24 struct RegistryKeyInfo {
25 HKEY rootkey;
26 const wchar_t* subkey;
29 // Collects then populates |process| with the sanitized paths of all DLLs
30 // loaded in the current process. Return false if an error occurred while
31 // querying for the loaded dlls.
32 bool CollectDlls(ClientIncidentReport_EnvironmentData_Process* process);
34 // For each of the dlls in this already populated incident report,
35 // check one of them is a registered LSP.
36 void RecordLspFeature(ClientIncidentReport_EnvironmentData_Process* process);
38 // Checks each module in the provided list for modifications and records these,
39 // along with any modified exports, in |process|.
40 void CollectModuleVerificationData(
41 const wchar_t* const modules_to_verify[],
42 size_t num_modules_to_verify,
43 ClientIncidentReport_EnvironmentData_Process* process);
45 // Populates |process| with the dll names that have been added to the chrome elf
46 // blacklist through the Windows registry.
47 void CollectDllBlacklistData(
48 ClientIncidentReport_EnvironmentData_Process* process);
50 // Populates |key_data| with the data in the registry keys specified. In case of
51 // error, this data may be incomplete.
52 void CollectRegistryData(
53 const RegistryKeyInfo* keys_to_collect,
54 size_t num_keys_to_collect,
55 google::protobuf::RepeatedPtrField<
56 ClientIncidentReport_EnvironmentData_OS_RegistryKey>* key_data);
58 } // namespace safe_browsing
60 #endif // CHROME_BROWSER_SAFE_BROWSING_INCIDENT_REPORTING_ENVIRONMENT_DATA_COLLECTION_WIN_H_