| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include <stdbool.h> |
| 6 #include <stddef.h> |
| 7 |
| 8 #include "base/basictypes.h" |
| 9 #include "base/logging.h" |
| 10 #include "base/message_loop.h" |
| 11 #include "base/message_loop_proxy.h" |
| 5 #include "base/message_loop_proxy_impl.h" | 12 #include "base/message_loop_proxy_impl.h" |
| 13 #include "base/ref_counted.h" |
| 14 #include "base/synchronization/lock.h" |
| 15 #include "base/task.h" |
| 6 #include "base/threading/thread_restrictions.h" | 16 #include "base/threading/thread_restrictions.h" |
| 17 #include "base/tracked.h" |
| 7 | 18 |
| 8 namespace base { | 19 namespace base { |
| 9 | 20 |
| 10 MessageLoopProxyImpl::~MessageLoopProxyImpl() { | 21 MessageLoopProxyImpl::~MessageLoopProxyImpl() { |
| 11 AutoLock lock(message_loop_lock_); | 22 AutoLock lock(message_loop_lock_); |
| 12 // If the target message loop still exists, the d'tor WILL execute on the | 23 // If the target message loop still exists, the d'tor WILL execute on the |
| 13 // target loop. | 24 // target loop. |
| 14 if (target_message_loop_) { | 25 if (target_message_loop_) { |
| 15 DCHECK(MessageLoop::current() == target_message_loop_); | 26 DCHECK(MessageLoop::current() == target_message_loop_); |
| 16 MessageLoop::current()->RemoveDestructionObserver(this); | 27 MessageLoop::current()->RemoveDestructionObserver(this); |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 102 return ret; | 113 return ret; |
| 103 } | 114 } |
| 104 | 115 |
| 105 scoped_refptr<MessageLoopProxy> | 116 scoped_refptr<MessageLoopProxy> |
| 106 MessageLoopProxy::CreateForCurrentThread() { | 117 MessageLoopProxy::CreateForCurrentThread() { |
| 107 scoped_refptr<MessageLoopProxy> ret(new MessageLoopProxyImpl()); | 118 scoped_refptr<MessageLoopProxy> ret(new MessageLoopProxyImpl()); |
| 108 return ret; | 119 return ret; |
| 109 } | 120 } |
| 110 | 121 |
| 111 } // namespace base | 122 } // namespace base |
| OLD | NEW |