void ScriptExecutionContext::destroyedMessagePort(MessagePort* port) { ASSERT(port); ASSERT((isDocument() && isMainThread()) || (isWorkerContext() && currentThread() == static_cast<WorkerContext*>(this)->thread()->threadID())); m_messagePorts.remove(port); }
void ScriptExecutionContext::createdMessagePort(MessagePort* port) { ASSERT(port); #if ENABLE(WORKERS) ASSERT((isDocument() && isMainThread()) || (isWorkerContext() && currentThread() == static_cast<WorkerContext*>(this)->thread()->threadID())); #endif m_messagePorts.add(port); }
JSC::JSGlobalData* ScriptExecutionContext::globalData() { if (isDocument()) return JSDOMWindow::commonJSGlobalData(); #if ENABLE(WORKERS) if (isWorkerContext()) return static_cast<WorkerContext*>(this)->script()->globalData(); #endif ASSERT_NOT_REACHED(); return 0; }