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_WIN_OBJECT_WATCHER_H_ | 5 #ifndef BASE_WIN_OBJECT_WATCHER_H_ |
6 #define BASE_WIN_OBJECT_WATCHER_H_ | 6 #define BASE_WIN_OBJECT_WATCHER_H_ |
7 | 7 |
8 #include <windows.h> | 8 #include <windows.h> |
9 | 9 |
10 #include "base/base_export.h" | 10 #include "base/base_export.h" |
11 #include "base/callback.h" | 11 #include "base/callback.h" |
12 #include "base/memory/weak_ptr.h" | 12 #include "base/memory/weak_ptr.h" |
13 #include "base/message_loop.h" | 13 #include "base/message_loop/message_loop.h" |
14 | 14 |
15 namespace base { | 15 namespace base { |
16 namespace win { | 16 namespace win { |
17 | 17 |
18 // A class that provides a means to asynchronously wait for a Windows object to | 18 // A class that provides a means to asynchronously wait for a Windows object to |
19 // become signaled. It is an abstraction around RegisterWaitForSingleObject | 19 // become signaled. It is an abstraction around RegisterWaitForSingleObject |
20 // that provides a notification callback, OnObjectSignaled, that runs back on | 20 // that provides a notification callback, OnObjectSignaled, that runs back on |
21 // the origin thread (i.e., the thread that called StartWatching). | 21 // the origin thread (i.e., the thread that called StartWatching). |
22 // | 22 // |
23 // This class acts like a smart pointer such that when it goes out-of-scope, | 23 // This class acts like a smart pointer such that when it goes out-of-scope, |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
94 HANDLE wait_object_; // Returned by RegisterWaitForSingleObject | 94 HANDLE wait_object_; // Returned by RegisterWaitForSingleObject |
95 MessageLoop* origin_loop_; // Used to get back to the origin thread | 95 MessageLoop* origin_loop_; // Used to get back to the origin thread |
96 | 96 |
97 DISALLOW_COPY_AND_ASSIGN(ObjectWatcher); | 97 DISALLOW_COPY_AND_ASSIGN(ObjectWatcher); |
98 }; | 98 }; |
99 | 99 |
100 } // namespace win | 100 } // namespace win |
101 } // namespace base | 101 } // namespace base |
102 | 102 |
103 #endif // BASE_OBJECT_WATCHER_H_ | 103 #endif // BASE_OBJECT_WATCHER_H_ |
OLD | NEW |