From eae9c0623d1800201739b4be146649103a45cd93 Mon Sep 17 00:00:00 2001 From: "erg@google.com" Date: Tue, 11 Jan 2011 00:50:59 +0000 Subject: Order function definitions in base/ according to the header. BUG=68682 TEST=compiles Review URL: http://codereview.chromium.org/6085015 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@70975 0039d316-1c4b-4281-b951-d872f2087c98 --- base/message_loop_proxy_impl.cc | 56 ++++++++++++++++++++--------------------- 1 file changed, 28 insertions(+), 28 deletions(-) (limited to 'base/message_loop_proxy_impl.cc') diff --git a/base/message_loop_proxy_impl.cc b/base/message_loop_proxy_impl.cc index 3b01fd6..b47c934 100644 --- a/base/message_loop_proxy_impl.cc +++ b/base/message_loop_proxy_impl.cc @@ -7,11 +7,6 @@ namespace base { -MessageLoopProxyImpl::MessageLoopProxyImpl() - : target_message_loop_(MessageLoop::current()) { - target_message_loop_->AddDestructionObserver(this); -} - MessageLoopProxyImpl::~MessageLoopProxyImpl() { AutoLock lock(message_loop_lock_); // If the target message loop still exists, the d'tor WILL execute on the @@ -56,25 +51,10 @@ bool MessageLoopProxyImpl::BelongsToCurrentThread() { (MessageLoop::current() == target_message_loop_)); } -bool MessageLoopProxyImpl::PostTaskHelper( - const tracked_objects::Location& from_here, Task* task, int64 delay_ms, - bool nestable) { - bool ret = false; - { - AutoLock lock(message_loop_lock_); - if (target_message_loop_) { - if (nestable) { - target_message_loop_->PostDelayedTask(from_here, task, delay_ms); - } else { - target_message_loop_->PostNonNestableDelayedTask(from_here, task, - delay_ms); - } - ret = true; - } - } - if (!ret) - delete task; - return ret; +// MessageLoop::DestructionObserver implementation +void MessageLoopProxyImpl::WillDestroyCurrentMessageLoop() { + AutoLock lock(message_loop_lock_); + target_message_loop_ = NULL; } void MessageLoopProxyImpl::OnDestruct() const { @@ -96,10 +76,30 @@ void MessageLoopProxyImpl::OnDestruct() const { delete this; } -// MessageLoop::DestructionObserver implementation -void MessageLoopProxyImpl::WillDestroyCurrentMessageLoop() { - AutoLock lock(message_loop_lock_); - target_message_loop_ = NULL; +MessageLoopProxyImpl::MessageLoopProxyImpl() + : target_message_loop_(MessageLoop::current()) { + target_message_loop_->AddDestructionObserver(this); +} + +bool MessageLoopProxyImpl::PostTaskHelper( + const tracked_objects::Location& from_here, Task* task, int64 delay_ms, + bool nestable) { + bool ret = false; + { + AutoLock lock(message_loop_lock_); + if (target_message_loop_) { + if (nestable) { + target_message_loop_->PostDelayedTask(from_here, task, delay_ms); + } else { + target_message_loop_->PostNonNestableDelayedTask(from_here, task, + delay_ms); + } + ret = true; + } + } + if (!ret) + delete task; + return ret; } scoped_refptr -- cgit v1.1