summaryrefslogtreecommitdiffstats
path: root/cc/thread.h
diff options
context:
space:
mode:
authorjamesr@chromium.org <jamesr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-10-30 22:59:56 +0000
committerjamesr@chromium.org <jamesr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-10-30 22:59:56 +0000
commite5e9c02081e6b37f49febeba87863a1dac598949 (patch)
tree3e2c4fcd2926cc064fd7937e3cdee49e9ef62fd6 /cc/thread.h
parent760d9886b9d56182f6c91944e06f250df6677d33 (diff)
downloadchromium_src-e5e9c02081e6b37f49febeba87863a1dac598949.zip
chromium_src-e5e9c02081e6b37f49febeba87863a1dac598949.tar.gz
chromium_src-e5e9c02081e6b37f49febeba87863a1dac598949.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 Review URL: https://codereview.chromium.org/11344004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@165050 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'cc/thread.h')
-rw-r--r--cc/thread.h23
1 files changed, 5 insertions, 18 deletions
diff --git a/cc/thread.h b/cc/thread.h
index 341b2db..a017c42 100644
--- a/cc/thread.h
+++ b/cc/thread.h
@@ -5,9 +5,8 @@
#ifndef CCThread_h
#define CCThread_h
+#include "base/callback.h"
#include "base/basictypes.h"
-#include "base/threading/platform_thread.h"
-#include <wtf/PassOwnPtr.h>
namespace cc {
@@ -17,25 +16,13 @@ class Thread {
public:
virtual ~Thread() { }
- class Task {
- public:
- virtual ~Task() { }
- virtual void performTask() = 0;
- void* instance() const { return m_instance; }
- protected:
- Task(void* instance) : m_instance(instance) { }
- void* m_instance;
- private:
- DISALLOW_COPY_AND_ASSIGN(Task);
- };
-
- // Executes the task on context's thread asynchronously.
- virtual void postTask(PassOwnPtr<Task>) = 0;
+ // Executes the callback on context's thread asynchronously.
+ virtual void postTask(base::Closure cb) = 0;
// Executes the task after the specified delay.
- virtual void postDelayedTask(PassOwnPtr<Task>, long long delayMs) = 0;
+ virtual void postDelayedTask(base::Closure cb, long long delayMs) = 0;
- virtual base::PlatformThreadId threadID() const = 0;
+ virtual bool belongsToCurrentThread() const = 0;
};
}