mirror of
https://github.com/chromium/crashpad.git
synced 2024-12-27 15:32:10 +08:00
Make ScopedGeneric uses slightly more consistent
R=scottmg@chromium.org Review URL: https://codereview.chromium.org/1426533008 .
This commit is contained in:
parent
ff274507dc
commit
81ece89d6a
@ -24,11 +24,6 @@ namespace crashpad {
|
||||
|
||||
namespace internal {
|
||||
|
||||
// static
|
||||
FileHandle ScopedLockedFileHandleTraits::InvalidValue() {
|
||||
return kInvalidFileHandle;
|
||||
}
|
||||
|
||||
// static
|
||||
void ScopedLockedFileHandleTraits::Free(FileHandle handle) {
|
||||
if (handle != kInvalidFileHandle) {
|
||||
|
@ -31,7 +31,7 @@ namespace crashpad {
|
||||
namespace internal {
|
||||
|
||||
struct ScopedLockedFileHandleTraits {
|
||||
static FileHandle InvalidValue();
|
||||
static FileHandle InvalidValue() { return kInvalidFileHandle; }
|
||||
static void Free(FileHandle handle);
|
||||
};
|
||||
|
||||
|
@ -525,6 +525,7 @@ struct ScopedRegistryKeyCloseTraits {
|
||||
RegCloseKey(key);
|
||||
}
|
||||
};
|
||||
|
||||
using ScopedRegistryKey =
|
||||
base::ScopedGeneric<HKEY, ScopedRegistryKeyCloseTraits>;
|
||||
|
||||
|
@ -17,10 +17,12 @@
|
||||
#include "base/logging.h"
|
||||
|
||||
namespace crashpad {
|
||||
namespace internal {
|
||||
|
||||
// static
|
||||
void LocalAllocTraits::Free(HLOCAL memory) {
|
||||
PLOG_IF(ERROR, LocalFree(memory) != nullptr) << "LocalFree";
|
||||
}
|
||||
|
||||
} // namespace internal
|
||||
} // namespace crashpad
|
||||
|
@ -21,12 +21,17 @@
|
||||
|
||||
namespace crashpad {
|
||||
|
||||
namespace internal {
|
||||
|
||||
struct LocalAllocTraits {
|
||||
static HLOCAL InvalidValue() { return nullptr; }
|
||||
static void Free(HLOCAL mem);
|
||||
};
|
||||
|
||||
using ScopedLocalAlloc = base::ScopedGeneric<HLOCAL, LocalAllocTraits>;
|
||||
} // namespace internal
|
||||
|
||||
using ScopedLocalAlloc =
|
||||
base::ScopedGeneric<HLOCAL, internal::LocalAllocTraits>;
|
||||
|
||||
} // namespace crashpad
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user