| // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| #include "base/synchronization/waitable_event_watcher.h" |
| #include "base/compiler_specific.h" |
| #include "base/profiler/scoped_profile.h" |
| #include "base/synchronization/waitable_event.h" |
| #include "base/win/object_watcher.h" |
| WaitableEventWatcher::WaitableEventWatcher() |
| WaitableEventWatcher::~WaitableEventWatcher() { |
| bool WaitableEventWatcher::StartWatching( |
| const EventCallback& callback) { |
| return watcher_.StartWatching(event->handle(), this); |
| void WaitableEventWatcher::StopWatching() { |
| WaitableEvent* WaitableEventWatcher::GetWatchedEvent() { |
| void WaitableEventWatcher::OnObjectSignaled(HANDLE h) { |
| // TODO(vadimt): Remove ScopedProfile below once crbug.com/418183 is fixed. |
| tracked_objects::ScopedProfile tracking_profile( |
| FROM_HERE_WITH_EXPLICIT_FUNCTION( |
| "WaitableEventWatche_OnObjectSignaled")); |
| WaitableEvent* event = event_; |
| EventCallback callback = callback_; |