| 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 #include "base/object_watcher.h" | 5 #include "base/win/object_watcher.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 | 8 |
| 9 namespace base { | 9 namespace base { |
| 10 namespace win { |
| 10 | 11 |
| 11 //----------------------------------------------------------------------------- | 12 //----------------------------------------------------------------------------- |
| 12 | 13 |
| 13 struct ObjectWatcher::Watch : public Task { | 14 struct ObjectWatcher::Watch : public Task { |
| 14 ObjectWatcher* watcher; // The associated ObjectWatcher instance | 15 ObjectWatcher* watcher; // The associated ObjectWatcher instance |
| 15 HANDLE object; // The object being watched | 16 HANDLE object; // The object being watched |
| 16 HANDLE wait_object; // Returned by RegisterWaitForSingleObject | 17 HANDLE wait_object; // Returned by RegisterWaitForSingleObject |
| 17 MessageLoop* origin_loop; // Used to get back to the origin thread | 18 MessageLoop* origin_loop; // Used to get back to the origin thread |
| 18 Delegate* delegate; // Delegate to notify when signaled | 19 Delegate* delegate; // Delegate to notify when signaled |
| 19 bool did_signal; // DoneWaiting was called | 20 bool did_signal; // DoneWaiting was called |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 128 // on the target thread. | 129 // on the target thread. |
| 129 watch->origin_loop->PostTask(FROM_HERE, watch); | 130 watch->origin_loop->PostTask(FROM_HERE, watch); |
| 130 } | 131 } |
| 131 | 132 |
| 132 void ObjectWatcher::WillDestroyCurrentMessageLoop() { | 133 void ObjectWatcher::WillDestroyCurrentMessageLoop() { |
| 133 // Need to shutdown the watch so that we don't try to access the MessageLoop | 134 // Need to shutdown the watch so that we don't try to access the MessageLoop |
| 134 // after this point. | 135 // after this point. |
| 135 StopWatching(); | 136 StopWatching(); |
| 136 } | 137 } |
| 137 | 138 |
| 139 } // namespace win |
| 138 } // namespace base | 140 } // namespace base |
| OLD | NEW |