michael@0: /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #ifndef mozilla_windowsdllblocklist_h michael@0: #define mozilla_windowsdllblocklist_h michael@0: michael@0: #if defined(_MSC_VER) && (defined(_M_IX86) || defined(_M_X64)) michael@0: michael@0: #include michael@0: #include "mozilla/GuardObjects.h" michael@0: #include "nscore.h" michael@0: michael@0: #define HAS_DLL_BLOCKLIST michael@0: michael@0: NS_IMPORT void DllBlocklist_Initialize(); michael@0: NS_IMPORT void DllBlocklist_SetInXPCOMLoadOnMainThread(bool inXPCOMLoadOnMainThread); michael@0: NS_IMPORT void DllBlocklist_WriteNotes(HANDLE file); michael@0: michael@0: class AutoSetXPCOMLoadOnMainThread michael@0: { michael@0: public: michael@0: AutoSetXPCOMLoadOnMainThread(MOZ_GUARD_OBJECT_NOTIFIER_ONLY_PARAM) { michael@0: MOZ_GUARD_OBJECT_NOTIFIER_INIT; michael@0: DllBlocklist_SetInXPCOMLoadOnMainThread(true); michael@0: } michael@0: michael@0: ~AutoSetXPCOMLoadOnMainThread() { michael@0: DllBlocklist_SetInXPCOMLoadOnMainThread(false); michael@0: } michael@0: michael@0: private: michael@0: MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER michael@0: }; michael@0: michael@0: #endif // defined(_MSC_VER) && (defined(_M_IX86) || defined(_M_X64)) michael@0: #endif // mozilla_windowsdllblocklist_h