From fb90c94fa3047eca1a40cb82441677a5ac49b9e8 Mon Sep 17 00:00:00 2001 From: "rsleevi@chromium.org" Date: Fri, 27 Apr 2012 23:40:50 +0000 Subject: RefCounted types should not have public destructors, content/browser part 1 BUG=123295 TEST=none Review URL: http://codereview.chromium.org/10068037 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@134395 0039d316-1c4b-4281-b951-d872f2087c98 --- content/browser/browser_thread_unittest.cc | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'content/browser/browser_thread_unittest.cc') diff --git a/content/browser/browser_thread_unittest.cc b/content/browser/browser_thread_unittest.cc index 6bb8e5a..57a7b52 100644 --- a/content/browser/browser_thread_unittest.cc +++ b/content/browser/browser_thread_unittest.cc @@ -7,6 +7,7 @@ #include "base/memory/scoped_ptr.h" #include "base/message_loop.h" #include "base/message_loop_proxy.h" +#include "base/sequenced_task_runner_helpers.h" #include "content/browser/browser_thread_impl.h" #include "content/test/test_browser_thread.h" #include "testing/gtest/include/gtest/gtest.h" @@ -46,12 +47,15 @@ class BrowserThreadTest : public testing::Test { explicit DeletedOnFile(MessageLoop* message_loop) : message_loop_(message_loop) { } + private: + friend struct BrowserThread::DeleteOnThread; + friend class base::DeleteHelper; + ~DeletedOnFile() { CHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); message_loop_->PostTask(FROM_HERE, MessageLoop::QuitClosure()); } - private: MessageLoop* message_loop_; }; @@ -59,6 +63,12 @@ class BrowserThreadTest : public testing::Test { : public base::RefCountedThreadSafe< NeverDeleted, BrowserThread::DeleteOnWebKitThread> { public: + + private: + friend struct BrowserThread::DeleteOnThread< + BrowserThread::WEBKIT_DEPRECATED>; + friend class base::DeleteHelper; + ~NeverDeleted() { CHECK(false); } -- cgit v1.1