Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(9)

Side by Side Diff: cc/base/thread_impl.cc

Issue 17114008: cc: Remove cc::Thread and cc::ThreadImpl. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rm-thread: NULLrefptrs Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « cc/base/thread_impl.h ('k') | cc/cc.gyp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(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/base/thread_impl.h"
6
7 #include "base/message_loop.h"
8
9 namespace cc {
10
11 scoped_ptr<Thread> ThreadImpl::CreateForCurrentThread() {
12 return scoped_ptr<Thread>(
13 new ThreadImpl(base::MessageLoopProxy::current())).Pass();
14 }
15
16 scoped_ptr<Thread> ThreadImpl::CreateForDifferentThread(
17 scoped_refptr<base::MessageLoopProxy> thread) {
18 return scoped_ptr<Thread>(new ThreadImpl(thread)).Pass();
19 }
20
21 ThreadImpl::~ThreadImpl() {}
22
23 void ThreadImpl::PostTask(base::Closure cb) {
24 thread_->PostTask(FROM_HERE, cb);
25 }
26
27 void ThreadImpl::PostDelayedTask(base::Closure cb, base::TimeDelta delay) {
28 thread_->PostDelayedTask(FROM_HERE, cb, delay);
29 }
30
31 bool ThreadImpl::BelongsToCurrentThread() const {
32 return thread_->BelongsToCurrentThread();
33 }
34
35 base::SingleThreadTaskRunner* ThreadImpl::TaskRunner() {
36 return thread_.get();
37 }
38
39 ThreadImpl::ThreadImpl(scoped_refptr<base::MessageLoopProxy> thread)
40 : thread_(thread) {}
41
42 } // namespace cc
OLDNEW
« no previous file with comments | « cc/base/thread_impl.h ('k') | cc/cc.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698