diff options
author | jamesr@chromium.org <jamesr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-10-30 23:29:50 +0000 |
---|---|---|
committer | jamesr@chromium.org <jamesr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-10-30 23:29:50 +0000 |
commit | 4a04889139472080d9be371c2c0f618c4da4e7a0 (patch) | |
tree | 56aa5d18e5e77b6248bd7293f7b43f2f95c713d0 /cc/test/scheduler_test_common.cc | |
parent | fe9d2edcd0ca528f1489fdb2df7ba5b9563f5f60 (diff) | |
download | chromium_src-4a04889139472080d9be371c2c0f618c4da4e7a0.zip chromium_src-4a04889139472080d9be371c2c0f618c4da4e7a0.tar.gz chromium_src-4a04889139472080d9be371c2c0f618c4da4e7a0.tar.bz2 |
Remove WebKit::Platform dependencies from cc
This removes all dependencies on the static WebKit::Platform pointer from cc.
The biggest change is implementing cc::Thread on top of base::MessageLoopProxy
instead of WebKit::WebThread. For the main thread cc::Thread simply binds to
the current thread's MessageLoopProxy. For the impl thread, the bindings layer
(specifically webkit/compositor_bindings/web_compositor_impl) extracts the
MessageLoopProxy out of the passed in WebThread.
BUG=144539
Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=165050
Review URL: https://codereview.chromium.org/11344004
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@165060 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'cc/test/scheduler_test_common.cc')
-rw-r--r-- | cc/test/scheduler_test_common.cc | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/cc/test/scheduler_test_common.cc b/cc/test/scheduler_test_common.cc index b2bedd8..4d2c13c 100644 --- a/cc/test/scheduler_test_common.cc +++ b/cc/test/scheduler_test_common.cc @@ -24,24 +24,31 @@ FakeThread::~FakeThread() { } -void FakeThread::postTask(PassOwnPtr<Task>) +void FakeThread::runPendingTask() { - NOTREACHED(); + ASSERT_TRUE(m_pendingTask); + scoped_ptr<base::Closure> task = m_pendingTask.Pass(); + task->Run(); } -void FakeThread::postDelayedTask(PassOwnPtr<Task> task, long long delay) +void FakeThread::postTask(base::Closure cb) +{ + postDelayedTask(cb, 0); +} + +void FakeThread::postDelayedTask(base::Closure cb, long long delay) { if (m_runPendingTaskOnOverwrite && hasPendingTask()) runPendingTask(); - EXPECT_TRUE(!hasPendingTask()); - m_pendingTask = task; + ASSERT_FALSE(hasPendingTask()); + m_pendingTask.reset(new base::Closure(cb)); m_pendingTaskDelay = delay; } -base::PlatformThreadId FakeThread::threadID() const +bool FakeThread::belongsToCurrentThread() const { - return 0; + return true; } void FakeTimeSource::setClient(cc::TimeSourceClient* client) |