Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1695)

Unified Diff: base/synchronization/waitable_event.h

Issue 593973002: Use ScopedHandle for the private members of WaitableEvent. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | base/synchronization/waitable_event_win.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/synchronization/waitable_event.h
diff --git a/base/synchronization/waitable_event.h b/base/synchronization/waitable_event.h
index 5d193c976ad7b7ef2d15ad19d784fbf8b3801eb1..39c0d11538cdf68727893eb0fd1beea91a83b8d0 100644
--- a/base/synchronization/waitable_event.h
+++ b/base/synchronization/waitable_event.h
@@ -9,7 +9,7 @@
#include "base/basictypes.h"
#if defined(OS_WIN)
-#include <windows.h>
+#include "base/win/scoped_handle.h"
#endif
#if defined(OS_POSIX)
@@ -53,6 +53,7 @@ class BASE_EXPORT WaitableEvent {
// Create a WaitableEvent from an Event HANDLE which has already been
// created. This objects takes ownership of the HANDLE and will close it when
// deleted.
+ // TODO(rvargas): Pass ScopedHandle instead (and on Release).
explicit WaitableEvent(HANDLE event_handle);
// Releases ownership of the handle from this object.
@@ -90,7 +91,7 @@ class BASE_EXPORT WaitableEvent {
bool TimedWait(const TimeDelta& max_time);
#if defined(OS_WIN)
- HANDLE handle() const { return handle_; }
+ HANDLE handle() const { return handle_.Get(); }
#endif
// Wait, synchronously, on multiple events.
@@ -140,7 +141,7 @@ class BASE_EXPORT WaitableEvent {
friend class WaitableEventWatcher;
#if defined(OS_WIN)
- HANDLE handle_;
+ win::ScopedHandle handle_;
#else
// On Windows, one can close a HANDLE which is currently being waited on. The
// MSDN documentation says that the resulting behaviour is 'undefined', but
« no previous file with comments | « no previous file | base/synchronization/waitable_event_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698