OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 #ifndef CHROME_ELF_BLACKLIST_BLACKLIST_H_ | 5 #ifndef CHROME_ELF_BLACKLIST_BLACKLIST_H_ |
6 #define CHROME_ELF_BLACKLIST_BLACKLIST_H_ | 6 #define CHROME_ELF_BLACKLIST_BLACKLIST_H_ |
7 | 7 |
8 namespace blacklist { | 8 namespace blacklist { |
9 | 9 |
10 // Max size of the DLL blacklist. | 10 // Max size of the DLL blacklist. |
11 const int kTroublesomeDllsMaxCount = 64; | 11 const int kTroublesomeDllsMaxCount = 64; |
12 | 12 |
13 // The DLL blacklist. | 13 // The DLL blacklist. |
14 extern const wchar_t* g_troublesome_dlls[kTroublesomeDllsMaxCount]; | 14 extern const wchar_t* g_troublesome_dlls[kTroublesomeDllsMaxCount]; |
15 | 15 |
16 // Cursor to the current last element in the blacklist. | |
17 extern int g_troublesome_dlls_cur_index; | |
18 | |
19 // The registry path of the blacklist beacon. | 16 // The registry path of the blacklist beacon. |
20 extern const wchar_t kRegistryBeaconPath[]; | 17 extern const wchar_t kRegistryBeaconPath[]; |
21 | 18 |
22 // The properties for the blacklist beacon. | 19 // The properties for the blacklist beacon. |
23 extern const wchar_t kBeaconVersion[]; | 20 extern const wchar_t kBeaconVersion[]; |
24 extern const wchar_t kBeaconState[]; | 21 extern const wchar_t kBeaconState[]; |
25 | 22 |
26 // The states for the blacklist setup code. | 23 // The states for the blacklist setup code. |
27 enum BlacklistState { | 24 enum BlacklistState { |
28 BLACKLIST_DISABLED = 0, | 25 BLACKLIST_DISABLED = 0, |
(...skipping 11 matching lines...) Expand all Loading... |
40 // The intent of the beacon is to act as an extra failure mode protection | 37 // The intent of the beacon is to act as an extra failure mode protection |
41 // whereby if Chrome for some reason fails to start during blacklist setup, | 38 // whereby if Chrome for some reason fails to start during blacklist setup, |
42 // it will skip blacklisting on the subsequent run. | 39 // it will skip blacklisting on the subsequent run. |
43 bool LeaveSetupBeacon(); | 40 bool LeaveSetupBeacon(); |
44 | 41 |
45 // Looks for the beacon that LeaveSetupBeacon() creates and resets it to | 42 // Looks for the beacon that LeaveSetupBeacon() creates and resets it to |
46 // to show the setup was successful. | 43 // to show the setup was successful. |
47 // Returns true if the beacon was successfully set to BLACKLIST_ENABLED. | 44 // Returns true if the beacon was successfully set to BLACKLIST_ENABLED. |
48 bool ResetBeacon(); | 45 bool ResetBeacon(); |
49 | 46 |
| 47 // Return the size of the current blacklist. |
| 48 int BlacklistSize(); |
| 49 |
50 // Adds the given dll name to the blacklist. Returns true if the dll name is in | 50 // Adds the given dll name to the blacklist. Returns true if the dll name is in |
51 // the blacklist when this returns, false on error. Note that this will copy | 51 // the blacklist when this returns, false on error. Note that this will copy |
52 // |dll_name| and will leak it on exit if the string is not subsequently removed | 52 // |dll_name| and will leak it on exit if the string is not subsequently removed |
53 // using RemoveDllFromBlacklist. | 53 // using RemoveDllFromBlacklist. |
54 extern "C" bool AddDllToBlacklist(const wchar_t* dll_name); | 54 extern "C" bool AddDllToBlacklist(const wchar_t* dll_name); |
55 | 55 |
56 // Removes the given dll name from the blacklist. Returns true if it was | 56 // Removes the given dll name from the blacklist. Returns true if it was |
57 // removed, false on error. | 57 // removed, false on error. |
58 extern "C" bool RemoveDllFromBlacklist(const wchar_t* dll_name); | 58 extern "C" bool RemoveDllFromBlacklist(const wchar_t* dll_name); |
59 | 59 |
60 // Initializes the DLL blacklist in the current process. This should be called | 60 // Initializes the DLL blacklist in the current process. This should be called |
61 // before any undesirable DLLs might be loaded. If |force| is set to true, then | 61 // before any undesirable DLLs might be loaded. If |force| is set to true, then |
62 // initialization will take place even if a beacon is present. This is useful | 62 // initialization will take place even if a beacon is present. This is useful |
63 // for tests. | 63 // for tests. |
64 bool Initialize(bool force); | 64 bool Initialize(bool force); |
65 | 65 |
66 } // namespace blacklist | 66 } // namespace blacklist |
67 | 67 |
68 #endif // CHROME_ELF_BLACKLIST_BLACKLIST_H_ | 68 #endif // CHROME_ELF_BLACKLIST_BLACKLIST_H_ |
OLD | NEW |