diff options
author | levin@chromium.org <levin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-10-07 20:17:33 +0000 |
---|---|---|
committer | levin@chromium.org <levin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-10-07 20:17:33 +0000 |
commit | 8ff672519df7fb4bfe32c4bf4639b383edfe45b9 (patch) | |
tree | 5d1d29c7876d2bcc287a552587a7e1dc04615271 /base/non_thread_safe.cc | |
parent | ccdf73e09a56a183b94a4a679041765f0bbaa2b5 (diff) | |
download | chromium_src-8ff672519df7fb4bfe32c4bf4639b383edfe45b9.zip chromium_src-8ff672519df7fb4bfe32c4bf4639b383edfe45b9.tar.gz chromium_src-8ff672519df7fb4bfe32c4bf4639b383edfe45b9.tar.bz2 |
Make ~GoogleURLChangeNotifier happen on the I/O thread.
Also change the test code to allow for its destruction.
One key problem was that the object containing WeakPtr is created on the UI
thread but then always used on the I/O thread like everything else that hangs
off of ResourceMessageFilter. The solution was to allow WeakPtr to detach
from its thread (and automatically re-attach the next time the thread is
checked).
BUG=38475
TEST=base_unittest --gtest_filter=NonThread*:ThreadChecker*
unit_tests --gtest_filter=SearchProviderInstallData*
Review URL: http://codereview.chromium.org/3627001
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@61836 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/non_thread_safe.cc')
-rw-r--r-- | base/non_thread_safe.cc | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/base/non_thread_safe.cc b/base/non_thread_safe.cc index 6889101..b01ed55 100644 --- a/base/non_thread_safe.cc +++ b/base/non_thread_safe.cc @@ -9,12 +9,16 @@ #include "base/logging.h" +NonThreadSafe::~NonThreadSafe() { + DCHECK(CalledOnValidThread()); +} + bool NonThreadSafe::CalledOnValidThread() const { return thread_checker_.CalledOnValidThread(); } -NonThreadSafe::~NonThreadSafe() { - DCHECK(CalledOnValidThread()); +void NonThreadSafe::DetachFromThread() { + thread_checker_.DetachFromThread(); } #endif // NDEBUG |