| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef BASE_SYNCHRONIZATION_WAITABLE_EVENT_WATCHER_H_ | 5 #ifndef BASE_SYNCHRONIZATION_WAITABLE_EVENT_WATCHER_H_ |
| 6 #define BASE_SYNCHRONIZATION_WAITABLE_EVENT_WATCHER_H_ | 6 #define BASE_SYNCHRONIZATION_WAITABLE_EVENT_WATCHER_H_ |
| 7 | 7 |
| 8 #include "base/base_export.h" | 8 #include "base/base_export.h" |
| 9 #include "base/macros.h" | 9 #include "base/macros.h" |
| 10 #include "base/sequence_checker.h" | 10 #include "base/sequence_checker.h" |
| 11 #include "build/build_config.h" | 11 #include "build/build_config.h" |
| 12 | 12 |
| 13 #if defined(OS_WIN) | 13 #if defined(OS_WIN) |
| 14 #include "base/win/object_watcher.h" | 14 #include "base/win/object_watcher.h" |
| 15 #else | 15 #else |
| 16 #include "base/callback.h" | 16 #include "base/callback.h" |
| 17 #include "base/synchronization/waitable_event.h" | 17 #include "base/synchronization/waitable_event.h" |
| 18 #endif | 18 #endif |
| 19 | 19 |
| 20 namespace base { | 20 namespace base { |
| 21 | 21 |
| 22 class Flag; | 22 class Flag; |
| 23 class AsyncWaiter; | 23 class AsyncWaiter; |
| 24 class AsyncCallbackTask; | |
| 25 class WaitableEvent; | 24 class WaitableEvent; |
| 26 | 25 |
| 27 // This class provides a way to wait on a WaitableEvent asynchronously. | 26 // This class provides a way to wait on a WaitableEvent asynchronously. |
| 28 // | 27 // |
| 29 // Each instance of this object can be waiting on a single WaitableEvent. When | 28 // Each instance of this object can be waiting on a single WaitableEvent. When |
| 30 // the waitable event is signaled, a callback is invoked on the sequence that | 29 // the waitable event is signaled, a callback is invoked on the sequence that |
| 31 // called StartWatching(). This callback can be deleted by deleting the waiter. | 30 // called StartWatching(). This callback can be deleted by deleting the waiter. |
| 32 // | 31 // |
| 33 // Typical usage: | 32 // Typical usage: |
| 34 // | 33 // |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 109 // sequence. | 108 // sequence. |
| 110 SequenceChecker sequence_checker_; | 109 SequenceChecker sequence_checker_; |
| 111 #endif | 110 #endif |
| 112 | 111 |
| 113 DISALLOW_COPY_AND_ASSIGN(WaitableEventWatcher); | 112 DISALLOW_COPY_AND_ASSIGN(WaitableEventWatcher); |
| 114 }; | 113 }; |
| 115 | 114 |
| 116 } // namespace base | 115 } // namespace base |
| 117 | 116 |
| 118 #endif // BASE_SYNCHRONIZATION_WAITABLE_EVENT_WATCHER_H_ | 117 #endif // BASE_SYNCHRONIZATION_WAITABLE_EVENT_WATCHER_H_ |
| OLD | NEW |