diff options
author | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-03-27 21:31:20 +0000 |
---|---|---|
committer | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-03-27 21:31:20 +0000 |
commit | 6ad4293c3bec41942397436dc54a5b764d014521 (patch) | |
tree | 6d7f49d2237bf8034613cd94ec7202fe98476633 /chrome/common/child_process.cc | |
parent | 9c470481ad452e18e937a95d6e62f827a7e8ab0d (diff) | |
download | chromium_src-6ad4293c3bec41942397436dc54a5b764d014521.zip chromium_src-6ad4293c3bec41942397436dc54a5b764d014521.tar.gz chromium_src-6ad4293c3bec41942397436dc54a5b764d014521.tar.bz2 |
Fix assertion that was firing in unit tests.
Review URL: http://codereview.chromium.org/56027
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@12710 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/common/child_process.cc')
-rw-r--r-- | chrome/common/child_process.cc | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/chrome/common/child_process.cc b/chrome/common/child_process.cc index 55f5bb0..326c7df 100644 --- a/chrome/common/child_process.cc +++ b/chrome/common/child_process.cc @@ -36,18 +36,21 @@ ChildProcess::~ChildProcess() { } void ChildProcess::AddRefProcess() { - DCHECK(MessageLoop::current() == child_thread_->message_loop()); + DCHECK(!child_thread_.get() || // null in unittests. + MessageLoop::current() == child_thread_->message_loop()); ref_count_++; } void ChildProcess::ReleaseProcess() { - DCHECK(MessageLoop::current() == child_thread_->message_loop()); + DCHECK(!child_thread_.get() || // null in unittests. + MessageLoop::current() == child_thread_->message_loop()); DCHECK(ref_count_); DCHECK(child_process_); if (--ref_count_) return; - child_thread_->OnProcessFinalRelease(); + if (child_thread_.get()) // null in unittests. + child_thread_->OnProcessFinalRelease(); } base::WaitableEvent* ChildProcess::GetShutDownEvent() { |