From 174213aed78f7bd2c654ab3797dec7485593402d Mon Sep 17 00:00:00 2001 From: "csharp@chromium.org" Date: Sat, 15 Feb 2014 00:32:30 +0000 Subject: Add a UMA stat to track if the Browser blacklist is Set on the Renderer This shouldn't be happening, but we got some crash reports suggesting it does. Unable to repo locally so this stat will verify it does occur and then can be used to verify our fixes actually fix it. TBR=asvitkine@chromium.org BUG=329023 Review URL: https://codereview.chromium.org/166953002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@251454 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome_elf/blacklist/blacklist.cc | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'chrome_elf/blacklist/blacklist.cc') diff --git a/chrome_elf/blacklist/blacklist.cc b/chrome_elf/blacklist/blacklist.cc index ea140c4..32d3cb2 100644 --- a/chrome_elf/blacklist/blacklist.cc +++ b/chrome_elf/blacklist/blacklist.cc @@ -60,6 +60,10 @@ enum WOW64Status { WOW64_UNKNOWN, }; +// Record if the blacklist was successfully initialized so processes can easily +// determine if the blacklist is enabled for them. +bool g_blacklist_initialized = false; + WOW64Status GetWOW64StatusForCurrentProcess() { typedef BOOL (WINAPI* IsWow64ProcessFunc)(HANDLE, PBOOL); IsWow64ProcessFunc is_wow64_process = reinterpret_cast( @@ -272,6 +276,10 @@ int BlacklistSize() { return size; } +bool IsBlacklistInitialized() { + return g_blacklist_initialized; +} + bool AddDllToBlacklist(const wchar_t* dll_name) { int blacklist_size = BlacklistSize(); // We need to leave one space at the end for the null pointer. @@ -373,6 +381,9 @@ bool Initialize(bool force) { } #endif + // Record that we have initialized the blacklist. + g_blacklist_initialized = true; + BYTE* thunk_storage = reinterpret_cast(&g_thunk_storage); // Mark the thunk storage as readable and writeable, since we -- cgit v1.1