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

Unified Diff: cc/thread_impl.cc

Issue 11344004: Remove WebKit::Platform dependencies from cc (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 8 years, 2 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 side-by-side diff with in-line comments
Download patch
Index: cc/thread_impl.cc
diff --git a/cc/thread_impl.cc b/cc/thread_impl.cc
new file mode 100644
index 0000000000000000000000000000000000000000..6d68a4c35a3bf9a9c14dc4274c917916a4cd2316
--- /dev/null
+++ b/cc/thread_impl.cc
@@ -0,0 +1,45 @@
+// Copyright 2011 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "cc/thread_impl.h"
+
+#include "base/message_loop.h"
+
+namespace cc {
+
+scoped_ptr<Thread> ThreadImpl::createForCurrentThread()
+{
+ return scoped_ptr<Thread>(new ThreadImpl(base::MessageLoopProxy::current())).Pass();
+}
+
+scoped_ptr<Thread> ThreadImpl::createForDifferentThread(scoped_refptr<base::MessageLoopProxy> thread)
+{
+ return scoped_ptr<Thread>(new ThreadImpl(thread)).Pass();
+}
+
+ThreadImpl::~ThreadImpl()
+{
+}
+
+void ThreadImpl::postTask(base::Closure cb)
+{
+ m_thread->PostTask(FROM_HERE, cb);
+}
+
+void ThreadImpl::postDelayedTask(base::Closure cb, long long delayMs)
+{
+ m_thread->PostDelayedTask(FROM_HERE, cb, base::TimeDelta::FromMilliseconds(delayMs));
enne (OOO) 2012/10/29 17:40:42 Wrapping all the postDelayedTask calls like this m
+}
+
+bool ThreadImpl::belongsToCurrentThread() const
+{
+ return m_thread->BelongsToCurrentThread();
+}
+
+ThreadImpl::ThreadImpl(scoped_refptr<base::MessageLoopProxy> thread)
+ : m_thread(thread)
+{
+}
+
+} // namespace cc
« cc/test/scheduler_test_common.cc ('K') | « cc/thread_impl.h ('k') | cc/thread_proxy.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698