void WebSharedWorkerImpl::connectTask(PassOwnPtr<WebMessagePortChannel> channel, ExecutionContext* context) { // Wrap the passed-in channel in a MessagePort, and send it off via a connect event. MessagePort* port = MessagePort::create(*context); port->entangle(channel); WorkerGlobalScope* workerGlobalScope = toWorkerGlobalScope(context); ASSERT_WITH_SECURITY_IMPLICATION(workerGlobalScope->isSharedWorkerGlobalScope()); workerGlobalScope->dispatchEvent(createConnectEvent(port)); }
void WebSharedWorkerImpl::connectTask(WebMessagePortChannelUniquePtr channel, ExecutionContext* context) { // Wrap the passed-in channel in a MessagePort, and send it off via a connect // event. MessagePort* port = MessagePort::create(*context); port->entangle(std::move(channel)); WorkerGlobalScope* workerGlobalScope = toWorkerGlobalScope(context); SECURITY_DCHECK(workerGlobalScope->isSharedWorkerGlobalScope()); workerGlobalScope->dispatchEvent(createConnectEvent(port)); }
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)); }
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)); }
SharedWorkerConnectTask(MessagePortChannel* channel) : ScriptExecutionContext::Task([=] (ScriptExecutionContext& context) { RefPtr<MessagePort> port = MessagePort::create(context); port->entangle(std::unique_ptr<MessagePortChannel>(channel)); ASSERT_WITH_SECURITY_IMPLICATION(context.isWorkerGlobalScope()); WorkerGlobalScope* workerGlobalScope = toWorkerGlobalScope(&context); // Since close() stops the thread event loop, this should not ever get called while closing. ASSERT(!workerGlobalScope->isClosing()); ASSERT_WITH_SECURITY_IMPLICATION(workerGlobalScope->isSharedWorkerGlobalScope()); workerGlobalScope->dispatchEvent(createConnectEvent(port)); }) { }