| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "build/build_config.h" | 9 #include "build/build_config.h" |
| 10 | 10 |
| 11 #if defined(OS_WIN) | 11 #if defined(OS_WIN) |
| 12 #include "base/win/object_watcher.h" | 12 #include "base/win/object_watcher.h" |
| 13 #else | 13 #else |
| 14 #include "base/callback.h" |
| 14 #include "base/message_loop.h" | 15 #include "base/message_loop.h" |
| 15 #include "base/synchronization/waitable_event.h" | 16 #include "base/synchronization/waitable_event.h" |
| 16 #endif | 17 #endif |
| 17 | 18 |
| 18 #include "base/base_export.h" | 19 #include "base/base_export.h" |
| 19 | 20 |
| 20 namespace base { | 21 namespace base { |
| 21 | 22 |
| 22 class Flag; | 23 class Flag; |
| 23 class AsyncWaiter; | 24 class AsyncWaiter; |
| (...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 143 win::ObjectWatcher watcher_; | 144 win::ObjectWatcher watcher_; |
| 144 #else | 145 #else |
| 145 // --------------------------------------------------------------------------- | 146 // --------------------------------------------------------------------------- |
| 146 // Implementation of MessageLoop::DestructionObserver | 147 // Implementation of MessageLoop::DestructionObserver |
| 147 // --------------------------------------------------------------------------- | 148 // --------------------------------------------------------------------------- |
| 148 virtual void WillDestroyCurrentMessageLoop() OVERRIDE; | 149 virtual void WillDestroyCurrentMessageLoop() OVERRIDE; |
| 149 | 150 |
| 150 MessageLoop* message_loop_; | 151 MessageLoop* message_loop_; |
| 151 scoped_refptr<Flag> cancel_flag_; | 152 scoped_refptr<Flag> cancel_flag_; |
| 152 AsyncWaiter* waiter_; | 153 AsyncWaiter* waiter_; |
| 153 AsyncCallbackTask* callback_task_; | 154 base::Closure callback_; |
| 154 scoped_refptr<WaitableEvent::WaitableEventKernel> kernel_; | 155 scoped_refptr<WaitableEvent::WaitableEventKernel> kernel_; |
| 155 #endif | 156 #endif |
| 156 | 157 |
| 157 WaitableEvent* event_; | 158 WaitableEvent* event_; |
| 158 | 159 |
| 159 Delegate* delegate_; | 160 Delegate* delegate_; |
| 160 }; | 161 }; |
| 161 | 162 |
| 162 } // namespace base | 163 } // namespace base |
| 163 | 164 |
| 164 #endif // BASE_SYNCHRONIZATION_WAITABLE_EVENT_WATCHER_H_ | 165 #endif // BASE_SYNCHRONIZATION_WAITABLE_EVENT_WATCHER_H_ |
| OLD | NEW |