From 81ece89d6aa65696347e47aa8a57fa0665f87d2e Mon Sep 17 00:00:00 2001 From: Mark Mentovai Date: Mon, 9 Nov 2015 15:33:36 -0500 Subject: [PATCH] Make ScopedGeneric uses slightly more consistent R=scottmg@chromium.org Review URL: https://codereview.chromium.org/1426533008 . --- client/settings.cc | 5 ----- client/settings.h | 2 +- util/win/process_info_test.cc | 1 + util/win/scoped_local_alloc.cc | 2 ++ util/win/scoped_local_alloc.h | 7 ++++++- 5 files changed, 10 insertions(+), 7 deletions(-) diff --git a/client/settings.cc b/client/settings.cc index 6d464077..32297811 100644 --- a/client/settings.cc +++ b/client/settings.cc @@ -24,11 +24,6 @@ namespace crashpad { namespace internal { -// static -FileHandle ScopedLockedFileHandleTraits::InvalidValue() { - return kInvalidFileHandle; -} - // static void ScopedLockedFileHandleTraits::Free(FileHandle handle) { if (handle != kInvalidFileHandle) { diff --git a/client/settings.h b/client/settings.h index ac22f68e..016f8d84 100644 --- a/client/settings.h +++ b/client/settings.h @@ -31,7 +31,7 @@ namespace crashpad { namespace internal { struct ScopedLockedFileHandleTraits { - static FileHandle InvalidValue(); + static FileHandle InvalidValue() { return kInvalidFileHandle; } static void Free(FileHandle handle); }; diff --git a/util/win/process_info_test.cc b/util/win/process_info_test.cc index 74f086db..52d8c787 100644 --- a/util/win/process_info_test.cc +++ b/util/win/process_info_test.cc @@ -525,6 +525,7 @@ struct ScopedRegistryKeyCloseTraits { RegCloseKey(key); } }; + using ScopedRegistryKey = base::ScopedGeneric; diff --git a/util/win/scoped_local_alloc.cc b/util/win/scoped_local_alloc.cc index e9388ee1..75838bc0 100644 --- a/util/win/scoped_local_alloc.cc +++ b/util/win/scoped_local_alloc.cc @@ -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 diff --git a/util/win/scoped_local_alloc.h b/util/win/scoped_local_alloc.h index 26a59ed8..b4607852 100644 --- a/util/win/scoped_local_alloc.h +++ b/util/win/scoped_local_alloc.h @@ -21,12 +21,17 @@ namespace crashpad { +namespace internal { + struct LocalAllocTraits { static HLOCAL InvalidValue() { return nullptr; } static void Free(HLOCAL mem); }; -using ScopedLocalAlloc = base::ScopedGeneric; +} // namespace internal + +using ScopedLocalAlloc = + base::ScopedGeneric; } // namespace crashpad