RefPtr<FetchRequest> FetchRequest::create(ScriptExecutionContext& context, FetchRequest& input, const Dictionary& init, ExceptionCode& ec) { if (input.isDisturbed()) { ec = TypeError; return nullptr; } FetchRequest::InternalRequest internalRequest(input.m_internalRequest); if (!buildOptions(internalRequest, context, init)) { ec = TypeError; return nullptr; } RefPtr<FetchHeaders> headers = buildHeaders(init, internalRequest, input.m_headers.ptr()); if (!headers) { ec = TypeError; return nullptr; } FetchBody body = buildBody(init, *headers, &input.m_body); if (!validateBodyAndMethod(body, internalRequest)) { ec = TypeError; return nullptr; } if (!input.m_body.isEmpty()) input.setDisturbed(); return adoptRef(*new FetchRequest(context, WTFMove(body), headers.releaseNonNull(), WTFMove(internalRequest))); }
GL3CharacterRenderer::GL3CharacterRenderer(Client *client, GL3Renderer *renderer) : client(client), renderer(renderer) { buildBody(); buildHead(); }
RefPtr<FetchRequest> FetchRequest::create(ScriptExecutionContext& context, const String& url, const Dictionary& init, ExceptionCode& ec) { // FIXME: Tighten the URL parsing algorithm according https://url.spec.whatwg.org/#concept-url-parser. URL requestURL = context.completeURL(url); if (!requestURL.isValid() || !requestURL.user().isEmpty() || !requestURL.pass().isEmpty()) { ec = TypeError; return nullptr; } FetchRequest::InternalRequest internalRequest; internalRequest.options.setMode(FetchOptions::Mode::Cors); internalRequest.options.setCredentials(FetchOptions::Credentials::Omit); internalRequest.referrer = ASCIILiteral("client"); internalRequest.request.setURL(requestURL); if (!buildOptions(internalRequest, context, init)) { ec = TypeError; return nullptr; } RefPtr<FetchHeaders> headers = buildHeaders(init, internalRequest); if (!headers) { ec = TypeError; return nullptr; } FetchBody body = buildBody(init, *headers); if (!validateBodyAndMethod(body, internalRequest)) { ec = TypeError; return nullptr; } return adoptRef(*new FetchRequest(context, WTFMove(body), headers.releaseNonNull(), WTFMove(internalRequest))); }
void SipDialogEvent::buildBodyGetBytes(UtlString* bytes, ssize_t* length) const { int dummy; buildBody(&dummy); *bytes = mBody; *length = bodyLength; }
// Construct body void buildBody(Body* value){ if(value != NULL) { glColor3f (0.5,0.5,1.0); glTranslatef(value->points->x, value->points->y, value->points->z); buildCube(); glTranslatef(-value->points->x, -value->points->y, -value->points->z); glColor3f (1.0,1.0,1.0); buildBody(value->next); glutPostRedisplay(); } }
void SpacePlane::enterField(WarField *target){ WarSpace *ws = *target; if(ws && ws->bdw){ buildBody(); ws->bdw->addRigidBody(bbody, 1, ~2); } if(ws){ TefpolList *tepl = w ? w->getTefpol3d() : NULL; for(int i = 0; i < pf.size(); i++){ if(this->pf[i]) this->pf[i]->immobilize(); if(tepl) pf[i] = tepl->addTefpolMovable(this->pos, this->velo, avec3_000, &cs_orangeburn, TEP3_THICKEST | TEP3_ROUGH, cs_orangeburn.t); else pf[i] = NULL; } } }
void Enemy::init(string n, Vector3 pos, float spd, float height, float width, float depth, ID3D10Device* d, Light* light) { device = d; name = n; position = pos; speed = spd; normalSpeed = speed; sprintBoost = speed * 3.3f; limbSpeed = speed * 0.5f; this->height = height; this->width = width; this->depth = depth; spotLight = light; buildBody(); }
void SpacePlane::unserialize(UnserializeContext &sc){ st::unserialize(sc); sc.i >> ai; sc.i >> undocktime; sc.i >> people; // Re-create temporary entities if flying in a WarSpace. // If surrounding WarSpace is unserialized after this function, it would cause errors, // but while WarSpace::dive defines that the WarSpace itself go first, it will never happen. WarSpace *ws; if(w && (ws = (WarSpace*)w)){ buildBody(); ws->bdw->addRigidBody(bbody, 1, ~2); setPosition(&pos, &rot, &this->velo, &omg); for(int i = 0; i < pf.size(); i++) pf[i] = ws->tepl->addTefpolMovable(this->pos, this->velo, avec3_000, &cs_orangeburn, TEP3_THICKEST | TEP3_ROUGH, cs_orangeburn.t); } else{ for(int i = 0; i < pf.size(); i++) pf[i] = NULL; } }
/* Construct snake */ void buildSnake(){ buildBody(snake->head); }