1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
3 /* This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
7 #ifndef mozilla_ipc_Neutering_h
8 #define mozilla_ipc_Neutering_h
11 * This header declares RAII wrappers for Window neutering. See
12 * WindowsMessageLoop.cpp for more details.
19 * This class is a RAII wrapper around Window neutering. As long as a
20 * NeuteredWindowRegion object is instantiated, Win32 windows belonging to the
21 * current thread will be neutered. It is safe to nest multiple instances of
24 class MOZ_RAII NeuteredWindowRegion
{
26 explicit NeuteredWindowRegion(bool aDoNeuter
);
27 ~NeuteredWindowRegion();
30 * This function clears any backlog of nonqueued messages that are pending for
40 * This class is analagous to MutexAutoUnlock for Mutex; it is an RAII class
41 * that is to be instantiated within a NeuteredWindowRegion, thus temporarily
42 * disabling neutering for the remainder of its enclosing block.
43 * @see NeuteredWindowRegion
45 class MOZ_RAII DeneuteredWindowRegion
{
47 explicit DeneuteredWindowRegion();
48 ~DeneuteredWindowRegion();
54 class MOZ_RAII SuppressedNeuteringRegion
{
56 explicit SuppressedNeuteringRegion();
57 ~SuppressedNeuteringRegion();
59 static inline bool IsNeuteringSuppressed() { return sSuppressNeutering
; }
64 static bool sSuppressNeutering
;
68 } // namespace mozilla
70 #endif // mozilla_ipc_Neutering_h