diff options
author | Steve Block <steveblock@google.com> | 2009-12-15 10:12:09 +0000 |
---|---|---|
committer | Steve Block <steveblock@google.com> | 2009-12-17 17:41:10 +0000 |
commit | 643ca7872b450ea4efacab6188849e5aac2ba161 (patch) | |
tree | 6982576c228bcd1a7efe98afed544d840751094c /WebCore/workers/WorkerRunLoop.h | |
parent | d026980fde6eb3b01c1fe49441174e89cd1be298 (diff) | |
download | external_webkit-643ca7872b450ea4efacab6188849e5aac2ba161.zip external_webkit-643ca7872b450ea4efacab6188849e5aac2ba161.tar.gz external_webkit-643ca7872b450ea4efacab6188849e5aac2ba161.tar.bz2 |
Merge webkit.org at r51976 : Initial merge by git.
Change-Id: Ib0e7e2f0fb4bee5a186610272edf3186f0986b43
Diffstat (limited to 'WebCore/workers/WorkerRunLoop.h')
-rw-r--r-- | WebCore/workers/WorkerRunLoop.h | 24 |
1 files changed, 19 insertions, 5 deletions
diff --git a/WebCore/workers/WorkerRunLoop.h b/WebCore/workers/WorkerRunLoop.h index 5f74f01..9d4edfd 100644 --- a/WebCore/workers/WorkerRunLoop.h +++ b/WebCore/workers/WorkerRunLoop.h @@ -36,7 +36,7 @@ #include "ScriptExecutionContext.h" #include <wtf/MessageQueue.h> #include <wtf/OwnPtr.h> -#include <wtf/PassRefPtr.h> +#include <wtf/PassOwnPtr.h> namespace WebCore { @@ -58,18 +58,32 @@ namespace WebCore { void terminate(); bool terminated() { return m_messageQueue.killed(); } - void postTask(PassRefPtr<ScriptExecutionContext::Task>); - void postTaskForMode(PassRefPtr<ScriptExecutionContext::Task>, const String& mode); + void postTask(PassOwnPtr<ScriptExecutionContext::Task>); + void postTaskForMode(PassOwnPtr<ScriptExecutionContext::Task>, const String& mode); unsigned long createUniqueId() { return ++m_uniqueId; } static String defaultMode(); - class Task; + + class Task : public Noncopyable { + public: + static PassOwnPtr<Task> create(PassOwnPtr<ScriptExecutionContext::Task> task, const String& mode); + ~Task() { } + const String& mode() const { return m_mode; } + void performTask(ScriptExecutionContext* context); + + private: + Task(PassOwnPtr<ScriptExecutionContext::Task> task, const String& mode); + + OwnPtr<ScriptExecutionContext::Task> m_task; + String m_mode; + }; + private: friend class RunLoopSetup; MessageQueueWaitResult runInMode(WorkerContext*, const ModePredicate&); - MessageQueue<RefPtr<Task> > m_messageQueue; + MessageQueue<Task> m_messageQueue; OwnPtr<WorkerSharedTimer> m_sharedTimer; int m_nestedCount; unsigned long m_uniqueId; |