| OLD | NEW |
| 1 // Copyright (c) 2006-2008 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_OBJECT_WATCHER_H_ | 5 #ifndef BASE_WIN_OBJECT_WATCHER_H_ |
| 6 #define BASE_OBJECT_WATCHER_H_ | 6 #define BASE_WIN_OBJECT_WATCHER_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <windows.h> | 9 #include <windows.h> |
| 10 | 10 |
| 11 #include "base/message_loop.h" | 11 #include "base/message_loop.h" |
| 12 | 12 |
| 13 namespace base { | 13 namespace base { |
| 14 namespace win { |
| 14 | 15 |
| 15 // A class that provides a means to asynchronously wait for a Windows object to | 16 // A class that provides a means to asynchronously wait for a Windows object to |
| 16 // become signaled. It is an abstraction around RegisterWaitForSingleObject | 17 // become signaled. It is an abstraction around RegisterWaitForSingleObject |
| 17 // that provides a notification callback, OnObjectSignaled, that runs back on | 18 // that provides a notification callback, OnObjectSignaled, that runs back on |
| 18 // the origin thread (i.e., the thread that called StartWatching). | 19 // the origin thread (i.e., the thread that called StartWatching). |
| 19 // | 20 // |
| 20 // This class acts like a smart pointer such that when it goes out-of-scope, | 21 // This class acts like a smart pointer such that when it goes out-of-scope, |
| 21 // UnregisterWaitEx is automatically called, and any in-flight notification is | 22 // UnregisterWaitEx is automatically called, and any in-flight notification is |
| 22 // suppressed. | 23 // suppressed. |
| 23 // | 24 // |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 80 // MessageLoop::DestructionObserver implementation: | 81 // MessageLoop::DestructionObserver implementation: |
| 81 virtual void WillDestroyCurrentMessageLoop(); | 82 virtual void WillDestroyCurrentMessageLoop(); |
| 82 | 83 |
| 83 // Internal state. | 84 // Internal state. |
| 84 struct Watch; | 85 struct Watch; |
| 85 Watch* watch_; | 86 Watch* watch_; |
| 86 | 87 |
| 87 DISALLOW_COPY_AND_ASSIGN(ObjectWatcher); | 88 DISALLOW_COPY_AND_ASSIGN(ObjectWatcher); |
| 88 }; | 89 }; |
| 89 | 90 |
| 91 } // namespace win |
| 90 } // namespace base | 92 } // namespace base |
| 91 | 93 |
| 92 #endif // BASE_OBJECT_WATCHER_H_ | 94 #endif // BASE_OBJECT_WATCHER_H_ |
| OLD | NEW |