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

Side by Side Diff: chrome_elf/blacklist/blacklist.h

Issue 1024183004: Fix chrome_elf_unittests to handle dlls being blacklisted before the tests start (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Responding to comments Created 5 years, 9 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 unified diff | Download patch
« no previous file with comments | « no previous file | chrome_elf/blacklist/test/blacklist_test.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #if defined(_WIN64) 8 #if defined(_WIN64)
9 #include "sandbox/win/src/sandbox_nt_types.h" 9 #include "sandbox/win/src/sandbox_nt_types.h"
10 #endif 10 #endif
(...skipping 17 matching lines...) Expand all
28 // repeatedly fails to start during blacklist setup, it will skip blacklisting 28 // repeatedly fails to start during blacklist setup, it will skip blacklisting
29 // on the subsequent run. 29 // on the subsequent run.
30 bool LeaveSetupBeacon(); 30 bool LeaveSetupBeacon();
31 31
32 // Looks for the setup running beacon that LeaveSetupBeacon() creates and resets 32 // Looks for the setup running beacon that LeaveSetupBeacon() creates and resets
33 // it to to show the setup was successful. 33 // it to to show the setup was successful.
34 // Returns true if the beacon was successfully set to BLACKLIST_ENABLED. 34 // Returns true if the beacon was successfully set to BLACKLIST_ENABLED.
35 bool ResetBeacon(); 35 bool ResetBeacon();
36 36
37 // Return the size of the current blacklist. 37 // Return the size of the current blacklist.
38 int BlacklistSize(); 38 extern "C" int BlacklistSize();
39 39
40 // Returns if true if the blacklist has been initialized. 40 // Returns if true if the blacklist has been initialized.
41 extern "C" bool IsBlacklistInitialized(); 41 extern "C" bool IsBlacklistInitialized();
42 42
43 // Returns the index of the DLL named |dll_name| on the blacklist, or -1 if not 43 // Returns the index of the DLL named |dll_name| on the blacklist, or -1 if not
44 // found. 44 // found.
45 extern "C" int GetBlacklistIndex(const wchar_t* dll_name); 45 extern "C" int GetBlacklistIndex(const wchar_t* dll_name);
46 46
47 // Adds the given dll name to the blacklist. Returns true if the dll name is in 47 // Adds the given dll name to the blacklist. Returns true if the dll name is in
48 // the blacklist when this returns, false on error. Note that this will copy 48 // the blacklist when this returns, false on error. Note that this will copy
(...skipping 13 matching lines...) Expand all
62 // The caller doesn't own the strings and isn't expected to free them. These 62 // The caller doesn't own the strings and isn't expected to free them. These
63 // strings won't be hanging unless RemoveDllFromBlacklist is called, but it 63 // strings won't be hanging unless RemoveDllFromBlacklist is called, but it
64 // is only exposed in tests (and should stay that way). 64 // is only exposed in tests (and should stay that way).
65 extern "C" void SuccessfullyBlocked(const wchar_t** blocked_dlls, int* size); 65 extern "C" void SuccessfullyBlocked(const wchar_t** blocked_dlls, int* size);
66 66
67 // Add the dlls, originally passed in through finch, from the registry to the 67 // Add the dlls, originally passed in through finch, from the registry to the
68 // blacklist so that they will be blocked identically to those hard coded in. 68 // blacklist so that they will be blocked identically to those hard coded in.
69 extern "C" void AddDllsFromRegistryToBlacklist(); 69 extern "C" void AddDllsFromRegistryToBlacklist();
70 70
71 // Record that the dll at the given index was blocked. 71 // Record that the dll at the given index was blocked.
72 void BlockedDll(size_t blocked_index); 72 extern "C" void BlockedDll(size_t blocked_index);
73 73
74 // Initializes the DLL blacklist in the current process. This should be called 74 // Initializes the DLL blacklist in the current process. This should be called
75 // before any undesirable DLLs might be loaded. If |force| is set to true, then 75 // before any undesirable DLLs might be loaded. If |force| is set to true, then
76 // initialization will take place even if a beacon is present. This is useful 76 // initialization will take place even if a beacon is present. This is useful
77 // for tests. 77 // for tests.
78 bool Initialize(bool force); 78 bool Initialize(bool force);
79 79
80 } // namespace blacklist 80 } // namespace blacklist
81 81
82 #endif // CHROME_ELF_BLACKLIST_BLACKLIST_H_ 82 #endif // CHROME_ELF_BLACKLIST_BLACKLIST_H_
OLDNEW
« no previous file with comments | « no previous file | chrome_elf/blacklist/test/blacklist_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698