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.
8 #include <wtf/PassOwnPtr.h>
9 #include <wtf/Threading.h>
13 // CCThread provides basic infrastructure for messaging with the compositor in a
14 // platform-neutral way.
17 virtual ~CCThread() { }
20 WTF_MAKE_NONCOPYABLE(Task
);
23 virtual void performTask() = 0;
24 void* instance() const { return m_instance
; }
26 Task(void* instance
) : m_instance(instance
) { }
30 // Executes the task on context's thread asynchronously.
31 virtual void postTask(PassOwnPtr
<Task
>) = 0;
33 // Executes the task after the specified delay.
34 virtual void postDelayedTask(PassOwnPtr
<Task
>, long long delayMs
) = 0;
36 virtual WTF::ThreadIdentifier
threadID() const = 0;