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

Side by Side Diff: base/synchronization/waitable_event_watcher_posix.cc

Issue 5977010: Move CancellationFlag and WaitableEvent to the synchronization subdirectory.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 11 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 #include "base/waitable_event_watcher.h" 5 #include "base/synchronization/waitable_event_watcher.h"
6 6
7 #include "base/message_loop.h" 7 #include "base/message_loop.h"
8 #include "base/synchronization/lock.h" 8 #include "base/synchronization/lock.h"
9 #include "base/waitable_event.h" 9 #include "base/synchronization/waitable_event.h"
10 10
11 namespace base { 11 namespace base {
12 12
13 // ----------------------------------------------------------------------------- 13 // -----------------------------------------------------------------------------
14 // WaitableEventWatcher (async waits). 14 // WaitableEventWatcher (async waits).
15 // 15 //
16 // The basic design is that we add an AsyncWaiter to the wait-list of the event. 16 // The basic design is that we add an AsyncWaiter to the wait-list of the event.
17 // That AsyncWaiter has a pointer to MessageLoop, and a Task to be posted to it. 17 // That AsyncWaiter has a pointer to MessageLoop, and a Task to be posted to it.
18 // The MessageLoop ends up running the task, which calls the delegate. 18 // The MessageLoop ends up running the task, which calls the delegate.
19 // 19 //
(...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after
271 // ----------------------------------------------------------------------------- 271 // -----------------------------------------------------------------------------
272 // This is called when the MessageLoop which the callback will be run it is 272 // This is called when the MessageLoop which the callback will be run it is
273 // deleted. We need to cancel the callback as if we had been deleted, but we 273 // deleted. We need to cancel the callback as if we had been deleted, but we
274 // will still be deleted at some point in the future. 274 // will still be deleted at some point in the future.
275 // ----------------------------------------------------------------------------- 275 // -----------------------------------------------------------------------------
276 void WaitableEventWatcher::WillDestroyCurrentMessageLoop() { 276 void WaitableEventWatcher::WillDestroyCurrentMessageLoop() {
277 StopWatching(); 277 StopWatching();
278 } 278 }
279 279
280 } // namespace base 280 } // namespace base
OLDNEW
« no previous file with comments | « base/synchronization/waitable_event_watcher.h ('k') | base/synchronization/waitable_event_watcher_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698