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

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

Issue 9997007: Objects that derive from RefCounted/RefCountedThreadSafe should not have public dtors. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: One more base/ change from a different CL Created 8 years, 8 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
« no previous file with comments | « base/synchronization/waitable_event.h ('k') | base/threading/worker_pool_posix.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/synchronization/waitable_event_watcher.h" 5 #include "base/synchronization/waitable_event_watcher.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/location.h" 8 #include "base/location.h"
9 #include "base/message_loop.h" 9 #include "base/message_loop.h"
10 #include "base/synchronization/lock.h" 10 #include "base/synchronization/lock.h"
(...skipping 25 matching lines...) Expand all
36 AutoLock locked(lock_); 36 AutoLock locked(lock_);
37 flag_ = true; 37 flag_ = true;
38 } 38 }
39 39
40 bool value() const { 40 bool value() const {
41 AutoLock locked(lock_); 41 AutoLock locked(lock_);
42 return flag_; 42 return flag_;
43 } 43 }
44 44
45 private: 45 private:
46 friend class RefCountedThreadSafe<Flag>;
47 virtual ~Flag() {}
jar (doing other things) 2012/04/05 23:04:59 Why bother saying virtual here? You didn't bother
48
46 mutable Lock lock_; 49 mutable Lock lock_;
47 bool flag_; 50 bool flag_;
48 }; 51 };
49 52
50 // ----------------------------------------------------------------------------- 53 // -----------------------------------------------------------------------------
51 // This is an asynchronous waiter which posts a task to a MessageLoop when 54 // This is an asynchronous waiter which posts a task to a MessageLoop when
52 // fired. An AsyncWaiter may only be in a single wait-list. 55 // fired. An AsyncWaiter may only be in a single wait-list.
53 // ----------------------------------------------------------------------------- 56 // -----------------------------------------------------------------------------
54 class AsyncWaiter : public WaitableEvent::Waiter { 57 class AsyncWaiter : public WaitableEvent::Waiter {
55 public: 58 public:
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after
256 // ----------------------------------------------------------------------------- 259 // -----------------------------------------------------------------------------
257 // This is called when the MessageLoop which the callback will be run it is 260 // This is called when the MessageLoop which the callback will be run it is
258 // deleted. We need to cancel the callback as if we had been deleted, but we 261 // deleted. We need to cancel the callback as if we had been deleted, but we
259 // will still be deleted at some point in the future. 262 // will still be deleted at some point in the future.
260 // ----------------------------------------------------------------------------- 263 // -----------------------------------------------------------------------------
261 void WaitableEventWatcher::WillDestroyCurrentMessageLoop() { 264 void WaitableEventWatcher::WillDestroyCurrentMessageLoop() {
262 StopWatching(); 265 StopWatching();
263 } 266 }
264 267
265 } // namespace base 268 } // namespace base
OLDNEW
« no previous file with comments | « base/synchronization/waitable_event.h ('k') | base/threading/worker_pool_posix.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698