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

Side by Side Diff: base/synchronization/waitable_event_watcher.h

Issue 6747014: Base: Last set of files to use BASE_API (for base.dll) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 9 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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/message_loop.h" 14 #include "base/message_loop.h"
15 #include "base/synchronization/waitable_event.h" 15 #include "base/synchronization/waitable_event.h"
16 #endif 16 #endif
17 17
18 #include "base/base_api.h"
19
18 namespace base { 20 namespace base {
19 21
20 class Flag; 22 class Flag;
21 class AsyncWaiter; 23 class AsyncWaiter;
22 class AsyncCallbackTask; 24 class AsyncCallbackTask;
23 class WaitableEvent; 25 class WaitableEvent;
24 26
25 // ----------------------------------------------------------------------------- 27 // -----------------------------------------------------------------------------
26 // This class provides a way to wait on a WaitableEvent asynchronously. 28 // This class provides a way to wait on a WaitableEvent asynchronously.
27 // 29 //
(...skipping 23 matching lines...) Expand all
51 // 53 //
52 // BEWARE: With automatically reset WaitableEvents, a signal may be lost if it 54 // BEWARE: With automatically reset WaitableEvents, a signal may be lost if it
53 // occurs just before a WaitableEventWatcher is deleted. There is currently no 55 // occurs just before a WaitableEventWatcher is deleted. There is currently no
54 // safe way to stop watching an automatic reset WaitableEvent without possibly 56 // safe way to stop watching an automatic reset WaitableEvent without possibly
55 // missing a signal. 57 // missing a signal.
56 // 58 //
57 // NOTE: you /are/ allowed to delete the WaitableEvent while still waiting on 59 // NOTE: you /are/ allowed to delete the WaitableEvent while still waiting on
58 // it with a Watcher. It will act as if the event was never signaled. 60 // it with a Watcher. It will act as if the event was never signaled.
59 // ----------------------------------------------------------------------------- 61 // -----------------------------------------------------------------------------
60 62
61 class WaitableEventWatcher 63 class BASE_API WaitableEventWatcher
62 #if defined(OS_POSIX) 64 #if defined(OS_POSIX)
63 : public MessageLoop::DestructionObserver 65 : public MessageLoop::DestructionObserver
64 #endif 66 #endif
65 { 67 {
66 public: 68 public:
67 69
68 WaitableEventWatcher(); 70 WaitableEventWatcher();
69 ~WaitableEventWatcher(); 71 ~WaitableEventWatcher();
70 72
71 class Delegate { 73 class Delegate {
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
153 #endif 155 #endif
154 156
155 WaitableEvent* event_; 157 WaitableEvent* event_;
156 158
157 Delegate* delegate_; 159 Delegate* delegate_;
158 }; 160 };
159 161
160 } // namespace base 162 } // namespace base
161 163
162 #endif // BASE_SYNCHRONIZATION_WAITABLE_EVENT_WATCHER_H_ 164 #endif // BASE_SYNCHRONIZATION_WAITABLE_EVENT_WATCHER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698