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.
13 class CCTimerTask
: public CCThread::Task
{
15 explicit CCTimerTask(CCTimer
* timer
)
26 ASSERT(m_timer
->m_task
== this);
35 CCTimerClient
* client
= m_timer
->m_client
;
39 client
->onTimerFired();
45 CCTimer
* m_timer
; // null if cancelled
48 CCTimer::CCTimer(CCThread
* thread
, CCTimerClient
* client
)
60 void CCTimer::startOneShot(double intervalSeconds
)
64 m_task
= new CCTimerTask(this);
66 // The thread expects delays in milliseconds.
67 m_thread
->postDelayedTask(adoptPtr(m_task
), intervalSeconds
* 1000.0);
79 } // namespace WebCore