// TODO(rvargas): remove this with the rest of the verifier. #ifdefined(COMPILER_MSVC) #include <intrin.h> #define BASE_WIN_GET_CALLER _ReturnAddress() #elifdefined(COMPILER_GCC) #define BASE_WIN_GET_CALLER \
__builtin_extract_return_addr(__builtin_return_address(0)) #endif
// Generic wrapper for raw handles that takes care of closing handles // automatically. The class interface follows the style of // the ScopedFILE class with two additions: // - IsValid() method can tolerate multiple invalid handle values such as NULL // and INVALID_HANDLE_VALUE (-1) for Win32 handles. // - Set() (and the constructors and assignment operators that call it) // preserve the Windows LastError code. This ensures that GetLastError() can // be called after stashing a handle in a GenericScopedHandle object. Doing // this explicitly is necessary because of bug 528394 and VC++ 2015. template <class Traits, class Verifier> class GenericScopedHandle {
public:
using Handle = typename Traits::Handle;
using UncheckedScopedHandle =
GenericScopedHandle<HandleTraits, DummyVerifierTraits>;
#ifdefined(MOZ_ZUCCHINI)
using ScopedHandle = UncheckedScopedHandle; #else
using CheckedScopedHandle = GenericScopedHandle<HandleTraits, VerifierTraits>;
#if DCHECK_IS_ON()
using ScopedHandle = CheckedScopedHandle; #else
using ScopedHandle = UncheckedScopedHandle; #endif #endif// defined(MOZ_ZUCCHINI)
#if !defined(MOZ_ZUCCHINI) // This function may be called by the embedder to disable the use of // VerifierTraits at runtime. It has no effect if DummyVerifierTraits is used // for ScopedHandle.
BASE_EXPORT void DisableHandleVerifier();
// This should be called whenever the OS is closing a handle, if extended // verification of improper handle closing is desired. If |handle| is being // tracked by the handle verifier and ScopedHandle is not the one closing it, // a CHECK is generated.
BASE_EXPORT void OnHandleBeingClosed(HANDLE handle, HandleOperation operation); #endif// !defined(MOZ_ZUCCHINI)
} // namespace win
} // namespace base
#endif// BASE_WIN_SCOPED_HANDLE_H_
Messung V0.5 in Prozent
¤ Dauer der Verarbeitung: 0.13 Sekunden
(vorverarbeitet am 2026-08-26)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.