OLD | NEW |
---|---|
(Empty) | |
1 // Copyright 2011 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #include "cc/thread_impl.h" | |
6 | |
7 #include "base/message_loop.h" | |
8 | |
9 namespace cc { | |
10 | |
11 scoped_ptr<Thread> ThreadImpl::createForCurrentThread() | |
12 { | |
13 return scoped_ptr<Thread>(new ThreadImpl(base::MessageLoopProxy::current())) .Pass(); | |
14 } | |
15 | |
16 scoped_ptr<Thread> ThreadImpl::createForDifferentThread(scoped_refptr<base::Mess ageLoopProxy> thread) | |
17 { | |
18 return scoped_ptr<Thread>(new ThreadImpl(thread)).Pass(); | |
19 } | |
20 | |
21 ThreadImpl::~ThreadImpl() | |
22 { | |
23 } | |
24 | |
25 void ThreadImpl::postTask(base::Closure cb) | |
26 { | |
27 m_thread->PostTask(FROM_HERE, cb); | |
28 } | |
29 | |
30 void ThreadImpl::postDelayedTask(base::Closure cb, long long delayMs) | |
31 { | |
32 m_thread->PostDelayedTask(FROM_HERE, cb, base::TimeDelta::FromMilliseconds(d elayMs)); | |
enne (OOO)
2012/10/29 17:40:42
Wrapping all the postDelayedTask calls like this m
| |
33 } | |
34 | |
35 bool ThreadImpl::belongsToCurrentThread() const | |
36 { | |
37 return m_thread->BelongsToCurrentThread(); | |
38 } | |
39 | |
40 ThreadImpl::ThreadImpl(scoped_refptr<base::MessageLoopProxy> thread) | |
41 : m_thread(thread) | |
42 { | |
43 } | |
44 | |
45 } // namespace cc | |
OLD | NEW |