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);
     ASSERT(workerContext->isSharedWorkerContext());
     workerContext->toSharedWorkerContext()->dispatchConnect(port);
 }
コード例 #2
0
void WebSharedWorkerImpl::connectTask(ScriptExecutionContext* context, PassOwnPtr<MessagePortChannel> channel)
{
    // Wrap the passed-in channel in a MessagePort, and send it off via a connect event.
    RefPtr<MessagePort> port = MessagePort::create(*context);
    port->entangle(channel);
    ASSERT(context->isWorkerContext());
    WorkerContext* workerContext = static_cast<WorkerContext*>(context);
    ASSERT(workerContext->isSharedWorkerContext());
    workerContext->dispatchEvent(createConnectEvent(port));
}
コード例 #3
0
 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));
 }