virtual void performTask(ScriptExecutionContext* scriptContext) { RefPtr<MessagePort> port = MessagePort::create(*scriptContext); port->entangle(m_channel.release()); ASSERT(scriptContext->isWorkerContext()); WorkerContext* workerContext = static_cast<WorkerContext*>(scriptContext); // Since close() stops the thread event loop, this should not ever get called while closing. ASSERT(!workerContext->isClosing()); ASSERT(workerContext->isSharedWorkerContext()); workerContext->toSharedWorkerContext()->dispatchEvent(createConnectEvent(port)); }
void WorkerRunLoop::Task::performTask(ScriptExecutionContext* context) { WorkerContext* workerContext = static_cast<WorkerContext *>(context); if (!workerContext->isClosing() || m_task->isCleanupTask()) m_task->performTask(context); }
void WorkerRunLoop::Task::performTask(const WorkerRunLoop& runLoop, ScriptExecutionContext* context) { WorkerContext* workerContext = static_cast<WorkerContext *>(context); if ((!workerContext->isClosing() && !runLoop.terminated()) || m_task->isCleanupTask()) m_task->performTask(context); }