Exemplo n.º 1
0
void JSCExecutor::onMessageReceived(int workerId, const std::string& json) {
    Object& worker = m_webWorkerJSObjs.at(workerId);

    Value onmessageValue = worker.getProperty("onmessage");
    if (onmessageValue.isUndefined()) {
        return;
    }

    JSValueRef args[] = { JSCWebWorker::createMessageObject(m_context, json) };
    onmessageValue.asObject().callAsFunction(1, args);

    m_flushImmediateCallback(flush(), true);
}
Exemplo n.º 2
0
void JSCExecutor::flushQueueImmediate(std::string queueJSON) {
  m_flushImmediateCallback(queueJSON);
}