summaryrefslogtreecommitdiffstats
path: root/base/synchronization
diff options
context:
space:
mode:
authorrsleevi@chromium.org <rsleevi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-04-06 03:14:30 +0000
committerrsleevi@chromium.org <rsleevi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-04-06 03:14:30 +0000
commitf2ebbf06167ad4ff8cb23109b3652c8c4b7ff5f7 (patch)
tree313e8a638cf92f3106aac2abce46841897012d41 /base/synchronization
parentc6cc03e309be697cfa1d5ca77960ae71caac538c (diff)
downloadchromium_src-f2ebbf06167ad4ff8cb23109b3652c8c4b7ff5f7.zip
chromium_src-f2ebbf06167ad4ff8cb23109b3652c8c4b7ff5f7.tar.gz
chromium_src-f2ebbf06167ad4ff8cb23109b3652c8c4b7ff5f7.tar.bz2
Objects that derive from RefCounted/RefCountedThreadSafe should not have public dtors.
BUG=none TEST=compiles Review URL: http://codereview.chromium.org/9997007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@131088 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/synchronization')
-rw-r--r--base/synchronization/waitable_event.h7
-rw-r--r--base/synchronization/waitable_event_watcher_posix.cc7
2 files changed, 11 insertions, 3 deletions
diff --git a/base/synchronization/waitable_event.h b/base/synchronization/waitable_event.h
index 6c91701..018f318 100644
--- a/base/synchronization/waitable_event.h
+++ b/base/synchronization/waitable_event.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 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.
@@ -145,7 +145,6 @@ class BASE_EXPORT WaitableEvent {
public RefCountedThreadSafe<WaitableEventKernel> {
public:
WaitableEventKernel(bool manual_reset, bool initially_signaled);
- virtual ~WaitableEventKernel();
bool Dequeue(Waiter* waiter, void* tag);
@@ -153,6 +152,10 @@ class BASE_EXPORT WaitableEvent {
const bool manual_reset_;
bool signaled_;
std::list<Waiter*> waiters_;
+
+ private:
+ friend class RefCountedThreadSafe<WaitableEventKernel>;
+ ~WaitableEventKernel();
};
typedef std::pair<WaitableEvent*, size_t> WaiterAndIndex;
diff --git a/base/synchronization/waitable_event_watcher_posix.cc b/base/synchronization/waitable_event_watcher_posix.cc
index 3b0ba70..5a17999 100644
--- a/base/synchronization/waitable_event_watcher_posix.cc
+++ b/base/synchronization/waitable_event_watcher_posix.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 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.
@@ -43,8 +43,13 @@ class Flag : public RefCountedThreadSafe<Flag> {
}
private:
+ friend class RefCountedThreadSafe<Flag>;
+ ~Flag() {}
+
mutable Lock lock_;
bool flag_;
+
+ DISALLOW_COPY_AND_ASSIGN(Flag);
};
// -----------------------------------------------------------------------------