Ejemplo n.º 1
0
RTC::Room* Loop::GetRoomFromRequest(Channel::Request* request, uint32_t* roomId)
{
	MS_TRACE();

	static const Json::StaticString k_roomId("roomId");

	auto json_roomId = request->internal[k_roomId];

	if (!json_roomId.isUInt())
		MS_THROW_ERROR("Request has not numeric internal.roomId");

	// If given, fill roomId.
	if (roomId)
		*roomId = json_roomId.asUInt();

	auto it = this->rooms.find(json_roomId.asUInt());
	if (it != this->rooms.end())
	{
		RTC::Room* room = it->second;

		return room;
	}
	else
	{
		return nullptr;
	}
}
Ejemplo n.º 2
0
void JitFragmentWriter::emitDelName(InternedString name) {
    call(false, (void*)ASTInterpreterJitInterface::delNameHelper, getInterp(),
#ifndef NDEBUG
         imm(asUInt(name).first), imm(asUInt(name).second));
#else
         imm(asUInt(name)));
#endif
}
Ejemplo n.º 3
0
RewriterVar* JitFragmentWriter::emitDeref(InternedString s) {
    return call(false, (void*)ASTInterpreterJitInterface::derefHelper, getInterp(),
#ifndef NDEBUG
                imm(asUInt(s).first), imm(asUInt(s).second));
#else
                imm(asUInt(s)));
#endif
}
Ejemplo n.º 4
0
void JitFragmentWriter::emitSetLocal(InternedString s, int vreg, bool set_closure, RewriterVar* v) {
    assert(vreg >= 0);
    if (set_closure) {
        call(false, (void*)ASTInterpreterJitInterface::setLocalClosureHelper, getInterp(), imm(vreg),
#ifndef NDEBUG
             imm(asUInt(s).first), imm(asUInt(s).second),
#else
             imm(asUInt(s)),
#endif
             v);
    } else {
        vregs_array->setAttr(8 * vreg, v);
    }
}
Ejemplo n.º 5
0
LargestUInt Value::asLargestUInt() const {
#if defined(JSON_NO_INT64)
  return asUInt();
#else
  return asUInt64();
#endif
}