void BD_Background::Init(void* packet) { setResource(packet); }
void HTMLImportLoader::startLoading(const ResourcePtr<RawResource>& resource) { setResource(resource); }
void DocumentThreadableLoader::loadRequest(const ResourceRequest& request) { // Any credential should have been removed from the cross-site requests. const KURL& requestURL = request.url(); ASSERT(m_sameOriginRequest || requestURL.user().isEmpty()); ASSERT(m_sameOriginRequest || requestURL.pass().isEmpty()); ThreadableLoaderOptions options = m_options; if (m_async) { if (m_actualRequest) { options.sniffContent = DoNotSniffContent; options.dataBufferingPolicy = BufferData; } if (m_options.timeoutMilliseconds > 0) m_timeoutTimer.startOneShot(m_options.timeoutMilliseconds / 1000.0); FetchRequest newRequest(request, m_options.initiator, options); ASSERT(!resource()); setResource(m_document->fetcher()->fetchRawResource(newRequest)); if (resource() && resource()->loader()) { unsigned long identifier = resource()->identifier(); InspectorInstrumentation::documentThreadableLoaderStartedLoadingForClient(m_document, identifier, m_client); } return; } FetchRequest fetchRequest(request, m_options.initiator, options); ResourcePtr<Resource> resource = m_document->fetcher()->fetchSynchronously(fetchRequest); ResourceResponse response = resource ? resource->response() : ResourceResponse(); unsigned long identifier = resource ? resource->identifier() : std::numeric_limits<unsigned long>::max(); ResourceError error = resource ? resource->resourceError() : ResourceError(); InspectorInstrumentation::documentThreadableLoaderStartedLoadingForClient(m_document, identifier, m_client); if (!resource) { m_client->didFail(error); return; } // No exception for file:/// resources, see <rdar://problem/4962298>. // Also, if we have an HTTP response, then it wasn't a network error in fact. if (!error.isNull() && !requestURL.isLocalFile() && response.httpStatusCode() <= 0) { m_client->didFail(error); return; } // FIXME: A synchronous request does not tell us whether a redirect happened or not, so we guess by comparing the // request and response URLs. This isn't a perfect test though, since a server can serve a redirect to the same URL that was // requested. Also comparing the request and response URLs as strings will fail if the requestURL still has its credentials. if (requestURL != response.url() && (!isAllowedByPolicy(response.url()) || !isAllowedRedirect(response.url()))) { m_client->didFailRedirectCheck(); return; } didReceiveResponse(identifier, response); SharedBuffer* data = resource->resourceBuffer(); if (data) didReceiveData(data->data(), data->size()); didFinishLoading(identifier, 0.0); }
void PendingScript::setScriptResource(ScriptResource* resource) { setResource(resource); }
WLink::WLink(WResource *resource) { setResource(resource); }
bool LinkLoader::loadLink(const LinkRelAttribute& relAttribute, CrossOriginAttributeValue crossOrigin, const String& type, const String& as, const String& media, const KURL& href, Document& document, const NetworkHintsInterface& networkHintsInterface) { // TODO(yoav): Do all links need to load only after they're in document??? // TODO(yoav): Convert all uses of the CrossOriginAttribute to // CrossOriginAttributeValue. crbug.com/486689 // FIXME(crbug.com/463266): We're ignoring type here, for everything but // preload. Maybe we shouldn't. dnsPrefetchIfNeeded(relAttribute, href, document, networkHintsInterface, LinkCalledFromMarkup); preconnectIfNeeded(relAttribute, href, document, crossOrigin, networkHintsInterface, LinkCalledFromMarkup); bool errorOccurred = false; if (m_client->shouldLoadLink()) { createLinkPreloadResourceClient(preloadIfNeeded( relAttribute, href, document, as, type, media, crossOrigin, LinkCalledFromMarkup, errorOccurred, nullptr)); } if (errorOccurred) m_linkLoadingErrorTimer.startOneShot(0, BLINK_FROM_HERE); if (href.isEmpty() || !href.isValid()) released(); // FIXME(crbug.com/323096): Should take care of import. if (relAttribute.isLinkPrefetch() && href.isValid() && document.frame()) { if (!m_client->shouldLoadLink()) return false; UseCounter::count(document, UseCounter::LinkRelPrefetch); FetchRequest linkRequest(ResourceRequest(document.completeURL(href)), FetchInitiatorTypeNames::link); if (crossOrigin != CrossOriginAttributeNotSet) { linkRequest.setCrossOriginAccessControl(document.getSecurityOrigin(), crossOrigin); } setResource(LinkFetchResource::fetch(Resource::LinkPrefetch, linkRequest, document.fetcher())); } if (const unsigned prerenderRelTypes = prerenderRelTypesFromRelAttribute(relAttribute, document)) { if (!m_prerender) { m_prerender = PrerenderHandle::create(document, this, href, prerenderRelTypes); } else if (m_prerender->url() != href) { m_prerender->cancel(); m_prerender = PrerenderHandle::create(document, this, href, prerenderRelTypes); } // TODO(gavinp): Handle changes to rel types of existing prerenders. } else if (m_prerender) { m_prerender->cancel(); m_prerender.clear(); } return true; }
void DocumentThreadableLoader::loadRequest(const ResourceRequest& request, ResourceLoaderOptions resourceLoaderOptions) { // Any credential should have been removed from the cross-site requests. const KURL& requestURL = request.url(); ASSERT(m_sameOriginRequest || requestURL.user().isEmpty()); ASSERT(m_sameOriginRequest || requestURL.pass().isEmpty()); // Update resourceLoaderOptions with enforced values. if (m_forceDoNotAllowStoredCredentials) resourceLoaderOptions.allowCredentials = DoNotAllowStoredCredentials; resourceLoaderOptions.securityOrigin = m_securityOrigin; if (m_async) { if (!m_actualRequest.isNull()) resourceLoaderOptions.dataBufferingPolicy = BufferData; if (m_options.timeoutMilliseconds > 0) m_timeoutTimer.startOneShot(m_options.timeoutMilliseconds / 1000.0, BLINK_FROM_HERE); FetchRequest newRequest(request, m_options.initiator, resourceLoaderOptions); if (m_options.crossOriginRequestPolicy == AllowCrossOriginRequests) newRequest.setOriginRestriction(FetchRequest::NoOriginRestriction); ASSERT(!resource()); if (request.requestContext() == WebURLRequest::RequestContextVideo || request.requestContext() == WebURLRequest::RequestContextAudio) setResource(RawResource::fetchMedia(newRequest, document().fetcher())); else if (request.requestContext() == WebURLRequest::RequestContextManifest) setResource(RawResource::fetchManifest(newRequest, document().fetcher())); else setResource(RawResource::fetch(newRequest, document().fetcher())); if (resource() && resource()->loader()) { unsigned long identifier = resource()->identifier(); InspectorInstrumentation::documentThreadableLoaderStartedLoadingForClient(m_document, identifier, m_client); } return; } FetchRequest fetchRequest(request, m_options.initiator, resourceLoaderOptions); if (m_options.crossOriginRequestPolicy == AllowCrossOriginRequests) fetchRequest.setOriginRestriction(FetchRequest::NoOriginRestriction); ResourcePtr<Resource> resource = RawResource::fetchSynchronously(fetchRequest, document().fetcher()); ResourceResponse response = resource ? resource->response() : ResourceResponse(); unsigned long identifier = resource ? resource->identifier() : std::numeric_limits<unsigned long>::max(); ResourceError error = resource ? resource->resourceError() : ResourceError(); InspectorInstrumentation::documentThreadableLoaderStartedLoadingForClient(m_document, identifier, m_client); if (!resource) { m_client->didFail(error); return; } // No exception for file:/// resources, see <rdar://problem/4962298>. // Also, if we have an HTTP response, then it wasn't a network error in fact. if (!error.isNull() && !requestURL.isLocalFile() && response.httpStatusCode() <= 0) { m_client->didFail(error); return; } // FIXME: A synchronous request does not tell us whether a redirect happened or not, so we guess by comparing the // request and response URLs. This isn't a perfect test though, since a server can serve a redirect to the same URL that was // requested. Also comparing the request and response URLs as strings will fail if the requestURL still has its credentials. if (requestURL != response.url() && (!isAllowedByContentSecurityPolicy(response.url(), ContentSecurityPolicy::DidRedirect) || !isAllowedRedirect(response.url()))) { m_client->didFailRedirectCheck(); return; } handleResponse(identifier, response, nullptr); // handleResponse() may detect an error. In such a case (check |m_client| // as it gets reset by clear() call), skip the rest. // // |this| is alive here since loadResourceSynchronously() keeps it alive // until the end of the function. if (!m_client) return; SharedBuffer* data = resource->resourceBuffer(); if (data) handleReceivedData(data->data(), data->size()); // The client may cancel this loader in handleReceivedData(). In such a // case, skip the rest. if (!m_client) return; handleSuccessfulFinish(identifier, 0.0); }
void KoDocumentResourceManager::setOdfDocument(KoOdfDocument *currentDocument) { QVariant variant; variant.setValue<void*>(currentDocument); setResource(OdfDocument, variant); }
void KoCanvasResourceManager::setActiveStroke(const KoShapeStroke &stroke) { QVariant v; v.setValue(stroke); setResource(ActiveStroke, v); }
void KoDocumentResourceManager::setUndoStack(KUndo2Stack *undoStack) { QVariant variant; variant.setValue<void*>(undoStack); setResource(UndoStack, variant); }
void KoDocumentResourceManager::setImageCollection(KoImageCollection *ic) { QVariant variant; variant.setValue<void*>(ic); setResource(ImageCollection, variant); }
void KoDocumentResourceManager::enablePasteAtCursor(bool enable) { setResource(PasteAtCursor, QVariant(enable)); }
void KoDocumentResourceManager::setPasteOffset(qreal pasteOffset) { setResource(PasteOffset, QVariant(pasteOffset)); }
void ApexResourceProvider::setResourceU32(const char* nameSpace, const char* name, uint32_t id, bool incRefCount) { setResource(nameSpace, name, (void*)(size_t)id, true, incRefCount); }
void ArrivalPaxLandsideBehavior::processEntryLandisde( const ElapsedTime& eEventTime ) { if(!m_pPerson) return; InitializeBehavior(); SetEnterLandsideLocation(location); if(simEngineConfig()->isSimTerminalMode()) { //WriteLogEntry(t); Processor* pProc= m_pPerson->getTerminalBehavior()->getLastTerminalProc(); ASSERT(pProc); if(pProc)//find { CString strProcName = pProc->getIDName(); CFacilityBehaviorsInSim *pFacilityBehavior = m_pPerson->getEngine()->GetLandsideSimulation()->getFacilityBehaviors(); LandsideResourceInSim* pLandsideLinkageObject = pFacilityBehavior->GetLandsideTerminalLinkage(*pProc->getID()); if(pLandsideLinkageObject) { //it could be curbside, bus station ... pLandsideLinkageObject->PassengerMoveInto(this, eEventTime); return; } else //the last processor is not link to any { //check parking spot LandsideResourceInSim *pDestResource = NULL; LandsideVehicleInSim* pVehicle = m_pPerson->getEngine()->GetLandsideSimulation()->FindPaxVehicle(m_pPerson->getID()); if(pVehicle) { setVehicle(pVehicle); } else //vehicle not entry simulation? { //LandsideSimErrorShown::PaxSimWarning(m_pPerson,_T("Pick Vehicle is not entry simulation yet"),_T("Pax Runtime Error"),eEventTime); terminate(eEventTime); return; } if(LandsideResourceInSim* pDestResource = pVehicle->getLastState().getLandsideRes() ) { setResource(pDestResource); //destination is parking lot setDestResource(pDestResource); setState(MoveToFacility); GenerateEvent(eEventTime + ElapsedTime(2L)); //@CodeWarn ?2sec what for return; } else { LandsideSimErrorShown::PaxSimWarning(m_pPerson,_T("Pax vehicle is not in any resource"),_T("Pax Runtime Error"),eEventTime); terminate(eEventTime); return; } } } else //no proc? { LandsideSimErrorShown::PaxSimWarning(m_pPerson,_T("No Last Processor"),_T("Pax Runtime Error"),eEventTime); terminate(eEventTime); return; } } else { if(!m_pVehicle) { LandsideVehicleInSim* pVehicle = m_pPerson->getEngine()->GetLandsideSimulation()->FindPaxVehicle(m_pPerson->getID()); if(pVehicle) { setVehicle(pVehicle); } else { ASSERT(FALSE); terminate(eEventTime); return; } } UpdateEntryTime(eEventTime); //get on to the vehicle straight CPoint2008 pos= m_pVehicle->getOffVehiclePos( CPoint2008(getPoint()) ); LandsideResourceInSim* pRes= m_pVehicle->getState(eEventTime).getLandsideRes(); setResource(pRes); setLocation(pos); setDestination(pos); WriteLogEntry(eEventTime); m_pPerson->setState(MoveToVehicle); GenerateEvent(eEventTime); } }
void KoCanvasResourceManager::setResource(int key, const KoColor &color) { QVariant v; v.setValue(color); setResource(key, v); }
Font::Font(MAHandle font) : mFontImage(0), mCharset(NULL), mLineSpacing(0) { setResource(font); }
void KoCanvasResourceManager::setResource(int key, KoShape *shape) { QVariant v; v.setValue(shape); setResource(key, v); }
void cUnit::addResource(float d, bool sendMessage) { setResource(resource + d, sendMessage); }
void KoCanvasResourceManager::setResource(int key, const KoUnit &unit) { QVariant v; v.setValue(unit); setResource(key, v); }
void CtrlrImageSlider::valueTreePropertyChanged (ValueTree &treeWhosePropertyHasChanged, const Identifier &property) { if (property == Ids::uiImageSliderResource) { setResource(); } else if (property == Ids::resourceImageWidth) { lf->setImage (filmStripImage, (int)getProperty(Ids::resourceImageWidth), (int)getProperty(Ids::resourceImageHeight)); } else if (property == Ids::resourceImageHeight) { lf->setImage (filmStripImage, (int)getProperty(Ids::resourceImageWidth), (int)getProperty(Ids::resourceImageHeight)); } else if (property == Ids::resourceImagePaintMode) { lf->setPaintMode ((RectanglePlacement)(int)getProperty(Ids::resourceImagePaintMode)); } else if (property == Ids::resourceImageOrientation) { lf->setOrientation((bool)getProperty(Ids::resourceImageOrientation)); } else if (property == Ids::uiSliderInterval || property == Ids::uiSliderMax || property == Ids::uiSliderMin) { ctrlrSlider->setRange ( getProperty (Ids::uiSliderMin), getProperty (Ids::uiSliderMax), getProperty (Ids::uiSliderInterval) ); owner.setProperty (Ids::modulatorMax, ctrlrSlider->getMaximum()); owner.setProperty (Ids::modulatorMin, ctrlrSlider->getMinimum()); } else if (property == Ids::uiSliderValueTextColour) { ctrlrSlider->setColour (Slider::textBoxTextColourId, VAR2COLOUR(getProperty (Ids::uiSliderValueTextColour)) ); } else if (property == Ids::uiSliderValueBgColour) { ctrlrSlider->setColour (Slider::textBoxBackgroundColourId, VAR2COLOUR(getProperty (Ids::uiSliderValueBgColour)) ); } else if (property == Ids::uiSliderValueHighlightColour) { ctrlrSlider->setColour (Slider::textBoxHighlightColourId, VAR2COLOUR(getProperty (Ids::uiSliderValueOutlineColour)) ); } else if (property == Ids::uiSliderValueOutlineColour) { ctrlrSlider->setColour (Slider::textBoxOutlineColourId, VAR2COLOUR(getProperty (Ids::uiSliderValueOutlineColour)) ); } else if (property == Ids::uiSliderValuePosition || property == Ids::uiSliderValueHeight || property == Ids::uiSliderValueWidth) { ctrlrSlider->setTextBoxStyle ( (Slider::TextEntryBoxPosition)(int)getProperty (Ids::uiSliderValuePosition), false, getProperty (Ids::uiSliderValueWidth, 64), getProperty (Ids::uiSliderValueHeight, 12)); } else if (property == Ids::uiSliderIncDecButtonColour || property == Ids::uiSliderIncDecTextColour || property == Ids::uiSliderValueFont || property == Ids::uiSliderValueTextJustification ) { lf->setOrientation((bool)getProperty(Ids::resourceImageOrientation)); lf->setImage (filmStripImage, (int)getProperty(Ids::resourceImageWidth), (int)getProperty(Ids::resourceImageHeight)); lookAndFeelChanged(); } else if (property == Ids::uiSliderStyle) { ctrlrSlider->setSliderStyle ((Slider::SliderStyle)CtrlrComponentTypeManager::sliderStringToStyle (getProperty (Ids::uiSliderStyle))); } else if (property == Ids::uiSliderVelocityMode || property == Ids::uiSliderVelocityModeKeyTrigger || property == Ids::uiSliderVelocitySensitivity || property == Ids::uiSliderVelocityThreshold || property == Ids::uiSliderVelocityOffset ) { ctrlrSlider->setVelocityBasedMode((bool)getProperty(Ids::uiSliderVelocityMode)); ctrlrSlider->setVelocityModeParameters ((double)getProperty(Ids::uiSliderVelocitySensitivity), (int)getProperty(Ids::uiSliderVelocityThreshold), (double)getProperty(Ids::uiSliderVelocityOffset), (bool)getProperty(Ids::uiSliderVelocityModeKeyTrigger)); } else if (property == Ids::uiSliderSpringValue) { ctrlrSlider->setValue (getProperty(property), dontSendNotification); } else if (property == Ids::uiSliderDoubleClickValue || property == Ids::uiSliderDoubleClickEnabled) { ctrlrSlider->setDoubleClickReturnValue ((bool)getProperty(Ids::uiSliderDoubleClickEnabled), getProperty(Ids::uiSliderDoubleClickValue)); } else if (property == Ids::uiSliderSpringMode) { if ((bool)getProperty(property) == true) { ctrlrSlider->setValue (getProperty(Ids::uiSliderSpringValue), dontSendNotification); } } else if (property == Ids::uiSliderPopupBubble) { ctrlrSlider->setPopupDisplayEnabled ((bool)getProperty(property), (bool)getProperty(property), owner.getOwnerPanel().getEditor()); } else { CtrlrComponent::valueTreePropertyChanged(treeWhosePropertyHasChanged, property); } if (restoreStateInProgress == false) { resized(); } }
void KoCanvasResourceManager::setForegroundColor(const KoColor &color) { setResource(ForegroundColor, color); }
void JabberContact::deserializeLine(const QString& key, const QString& value) { QString val = value; if(val.startsWith('\"') && val.endsWith('\"')) val = val.mid(1, val.length() - 2); if(key == "ID") { setId(val); } else if(key == "Node") { setNode(val); } else if(key == "Resource") { setResource(val); } else if(key == "Name") { setName(val); } else if(key == "FirstName") { setFirstName(val); } else if(key == "Nick") { setNick(val); } else if(key == "Desc") { setDesc(val); } else if(key == "BirthDay") { setBirthday(val); } else if(key == "Url") { setUrl(val); } else if(key == "OrgName") { setOrgName(val); } else if(key == "OrgUnit") { setOrgUnit(val); } else if(key == "Title") { setTitle(val); } else if(key == "Role") { setRole(val); } else if(key == "Street") { setStreet(val); } else if(key == "ExtAddr") { setExtAddr(val); } else if(key == "City") { setCity(val); } else if(key == "Region") { setRegion(val); } else if(key == "PCode") { setPCode(val); } else if(key == "Country") { setCountry(val); } else if(key == "EMail") { setEmail(val); } else if(key == "Phone") { setPhone(val); } else if(key == "StatusTime") { setStatusTime(val.toUInt()); } else if(key == "OnlineTime") { setOnlineTime(val.toUInt()); } else if(key == "Subscribe") { setSubscribe(val.toUInt()); } else if(key == "Group") { setGroup(val); } else if(key == "PhotoWidth") { setPhotoWidth(val.toUInt()); } else if(key == "PhotoHeight") { setPhotoHeight(val.toUInt()); } else if(key == "LogoWidth") { setLogoWidth(val.toUInt()); } else if(key == "LogoHeight") { setLogoHeight(val.toUInt()); } else if(key == "AutoReply") { setAutoReply(val); } }
Nepomuk::Query::ResourceTerm::ResourceTerm( const Nepomuk::Resource& resource ) : Term( new ResourceTermPrivate() ) { setResource( resource ); }
void BD_SlideSelector::Init(void* packet) { setResource(packet); }
void BD_SlideControl::Init(void* packet) { setResource(packet); }
void HTMLImportLoader::startLoading(RawResource* resource) { setResource(resource); }
WorkletScriptLoader::WorkletScriptLoader(ScriptPromiseResolver* resolver, Worklet* worklet, ScriptResource* resource) : m_resolver(resolver), m_host(worklet) { setResource(resource); }