diff options
author | Steve Block <steveblock@google.com> | 2009-10-08 17:19:54 +0100 |
---|---|---|
committer | Steve Block <steveblock@google.com> | 2009-10-20 00:41:58 +0100 |
commit | 231d4e3152a9c27a73b6ac7badbe6be673aa3ddf (patch) | |
tree | a6c7e2d6cd7bfa7011cc39abbb436142d7a4a7c8 /WebCore/workers/WorkerRunLoop.cpp | |
parent | e196732677050bd463301566a68a643b6d14b907 (diff) | |
download | external_webkit-231d4e3152a9c27a73b6ac7badbe6be673aa3ddf.zip external_webkit-231d4e3152a9c27a73b6ac7badbe6be673aa3ddf.tar.gz external_webkit-231d4e3152a9c27a73b6ac7badbe6be673aa3ddf.tar.bz2 |
Merge webkit.org at R49305 : Automatic merge by git.
Change-Id: I8968561bc1bfd72b8923b7118d3728579c6dbcc7
Diffstat (limited to 'WebCore/workers/WorkerRunLoop.cpp')
-rw-r--r-- | WebCore/workers/WorkerRunLoop.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/WebCore/workers/WorkerRunLoop.cpp b/WebCore/workers/WorkerRunLoop.cpp index cb31fe7..39b21c6 100644 --- a/WebCore/workers/WorkerRunLoop.cpp +++ b/WebCore/workers/WorkerRunLoop.cpp @@ -77,7 +77,7 @@ public: private: Task(PassRefPtr<ScriptExecutionContext::Task> task, const String& mode) : m_task(task) - , m_mode(mode.copy()) + , m_mode(mode.crossThreadString()) { } @@ -173,6 +173,10 @@ MessageQueueWaitResult WorkerRunLoop::runInMode(WorkerContext* context, const Mo RefPtr<Task> task; MessageQueueWaitResult result = m_messageQueue.waitForMessageFilteredWithTimeout(task, predicate, absoluteTime); + // If the context is closing, don't dispatch any further tasks (per section 4.1.1 of the Web Workers spec). + if (context->isClosing()) + return result; + switch (result) { case MessageQueueTerminated: break; @@ -201,7 +205,7 @@ void WorkerRunLoop::postTask(PassRefPtr<ScriptExecutionContext::Task> task) void WorkerRunLoop::postTaskForMode(PassRefPtr<ScriptExecutionContext::Task> task, const String& mode) { - m_messageQueue.append(Task::create(task, mode.copy())); + m_messageQueue.append(Task::create(task, mode.crossThreadString())); } } // namespace WebCore |