// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file.
// 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
namespace base { namespace win {
// 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 ScopedHandle = GenericScopedHandle<HandleTraits, VerifierTraits>;
// 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);
} // namespace win
} // namespace base
#endif// BASE_WIN_SCOPED_HANDLE_H_
Messung V0.5 in Prozent
¤ Dauer der Verarbeitung: 0.13 Sekunden
(vorverarbeitet am 2026-04-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.