void CachedResource::error(CachedResource::Status status) { setStatus(status); ASSERT(errorOccurred()); m_data = nullptr; setLoading(false); checkNotify(); }
CachedImage::CachedImage(const URL& url, Image* image, SessionID sessionID) : CachedResource(ResourceRequest(url), ImageResource, sessionID) , m_image(image) , m_isManuallyCached(false) , m_shouldPaintBrokenImage(true) { setStatus(Cached); setLoading(false); }
void CachedResource::cancelLoad() { if (!isLoading() && !stillNeedsLoad()) return; setStatus(LoadError); setLoading(false); checkNotify(); }
void Engine::SurfaceChanged(int width, int height) { DEBUG_LOG_WRITE_D("TAG", "Changed"); SetShader("shaders/draw", ShaderType::Draw, true); this->InitiseRenderer(); this->SetResolution(Maths::Vector2<int>(width, height)); setLoading(false); }
ImageResource::ImageResource(const ResourceRequest& resourceRequest, blink::Image* image) : Resource(resourceRequest, Image) , m_image(image) { WTF_LOG(Timers, "new ImageResource(ResourceRequest, Image) %p", this); setStatus(Cached); setLoading(false); setCustomAcceptHeader(); }
void LWJGLVersionList::loadList() { Q_ASSERT_X(!m_loading, "loadList", "list is already loading (m_loading is true)"); setLoading(true); auto worker = MMC->qnam(); reply = worker->get(QNetworkRequest(QUrl(RSS_URL))); connect(reply, SIGNAL(finished()), SLOT(netRequestComplete())); }
void CachedXSLStyleSheet::finishLoading(SharedBuffer* data) { m_data = data; setEncodedSize(data ? data->size() : 0); if (data) m_sheet = m_decoder->decodeAndFlush(data->data(), encodedSize()); setLoading(false); checkNotify(); }
CachedImage::CachedImage(Image* image) : CachedResource(ResourceRequest(), ImageResource) , m_image(image) , m_decodedDataDeletionTimer(this, &CachedImage::decodedDataDeletionTimerFired) , m_shouldPaintBrokenImage(true) , m_autoLoadWasPreventedBySettings(false) { setStatus(Cached); setLoading(false); }
void CachedScript::data(PassRefPtr<ResourceBuffer> data, bool allDataReceived) { if (!allDataReceived) return; m_data = data; setEncodedSize(m_data.get() ? m_data->size() : 0); setLoading(false); checkNotify(); }
void CachedImage::load(CachedResourceLoader* cachedResourceLoader) { #ifdef ANDROID_BLOCK_NETWORK_IMAGE if (!cachedResourceLoader || (cachedResourceLoader->autoLoadImages() && !cachedResourceLoader->shouldBlockNetworkImage(m_url))) #else if (!cachedResourceLoader || cachedResourceLoader->autoLoadImages()) #endif CachedResource::load(cachedResourceLoader, true, DoSecurityCheck, true); else setLoading(false); }
void CachedImage::error(CachedResource::Status status) { checkShouldPaintBrokenImage(); clear(); setStatus(status); ASSERT(errorOccurred()); m_data.clear(); notifyObservers(); setLoading(false); checkNotify(); }
void DocumentLoader::prepareForLoadStart() { ASSERT(!m_isStopping); setPrimaryLoadComplete(false); ASSERT(frameLoader()); clearErrors(); setLoading(true); frameLoader()->prepareForLoadStart(); }
ImageResource::ImageResource(blink::Image* image) : Resource(ResourceRequest(""), Image) , m_devicePixelRatioHeaderValue(1.0) , m_image(image) , m_hasDevicePixelRatioHeaderValue(false) { WTF_LOG(Timers, "new ImageResource(Image) %p", this); setStatus(Cached); setLoading(false); setCustomAcceptHeader(); }
void Engine::SurfaceCreated() { setLoading(true); DEBUG_LOG_WRITE_V("Render", "Surface created"); Assets::LoadAsset("textures/air_hockey_surface", Assets::TEXTURE); Assets::LoadAsset("textures/tilesheet", Assets::AssetType::TEXTURE); Assets::LoadAsset("shaders/draw", Assets::SHADER); Assets::LoadAsset("shaders/tile", Assets::SHADER); }
void DeviceSettingsItem::setDevice(const Device *device) { connect(device, &Device::nameChanged, m_titleLabel, &NormalLabel::setText); connect(device, &Device::stateChanged, this, &DeviceSettingsItem::onDeviceStateChanged); connect(device, &Device::pairedChanged, this, &DeviceSettingsItem::onDevicePairedChanged); connect(device, &Device::connectingChanged, this, &DeviceSettingsItem::setLoading); m_titleLabel->setText(device->name()); setLoading(device->connecting()); onDeviceStateChanged(device->state()); onDevicePairedChanged(device->paired()); }
void LWJGLVersionList::loadList() { Q_ASSERT_X(!m_loading, "loadList", "list is already loading (m_loading is true)"); setLoading(true); auto worker = MMC->qnam(); QNetworkRequest req(QUrl(RSS_URL)); req.setRawHeader("Accept", "text/xml"); req.setRawHeader("User-Agent", "MultiMC/5.0 (Uncached)"); reply = worker->get(req); connect(reply, SIGNAL(finished()), SLOT(netRequestComplete())); }
void CachedImage::load(CachedResourceLoader& loader) { if (loader.shouldPerformImageLoad(url())) CachedResource::load(loader); else setLoading(false); if (m_loader) { m_allowSubsampling = m_loader->frameLoader()->frame().settings().imageSubsamplingEnabled(); m_allowAsyncImageDecoding = m_loader->frameLoader()->frame().settings().asyncImageDecodingEnabled(); m_showDebugBackground = m_loader->frameLoader()->frame().settings().showDebugBorders(); } }
void CachedCSSStyleSheet::finishLoading(ResourceBuffer* data) { m_data = data; setEncodedSize(m_data.get() ? m_data->size() : 0); // Decode the data to find out the encoding and keep the sheet text around during checkNotify() if (m_data) { m_decodedSheetText = m_decoder->decode(m_data->data(), m_data->size()); m_decodedSheetText.append(m_decoder->flush()); } setLoading(false); checkNotify(); // Clear the decoded text as it is unlikely to be needed immediately again and is cheap to regenerate. m_decodedSheetText = String(); }
void RunModel::load(const QString& search) { if (isLoading()) return; mSearch = search; setLoading(true); QNetworkReply * reply = TorrentServerManager::i()->getResultList(mOffset, search); connect(reply,SIGNAL(finished()),this,SLOT(loadded())); }
void CachedXSLStyleSheet::data(PassRefPtr<SharedBuffer> data, bool allDataReceived) { if (!allDataReceived) return; m_data = data; setEncodedSize(m_data.get() ? m_data->size() : 0); if (m_data.get()) { m_sheet = String(m_decoder->decode(m_data->data(), encodedSize())); m_sheet += m_decoder->flush(); } setLoading(false); checkNotify(); }
CachedImage::CachedImage(const URL& url, Image* image, CachedImage::CacheBehaviorType type, SessionID sessionID) : CachedResource(ResourceRequest(url), ImageResource, sessionID) , m_image(image) , m_isManuallyCached(type == CachedImage::ManuallyCached) , m_shouldPaintBrokenImage(true) { setStatus(Cached); setLoading(false); if (UNLIKELY(isManuallyCached())) { // Use the incoming URL in the response field. This ensures that code // using the response directly, such as origin checks for security, // actually see something. m_response.setURL(url); } }
void DeviceSettingsItem::mouseReleaseEvent(QMouseEvent *event) { if (m_device->state() != Device::StateConnected) { event->accept(); Q_EMIT requestConnectDevice(m_device); } if (m_device->state() == Device::StateConnected) { setLoading(true); QTimer::singleShot(1000, this, &DeviceSettingsItem::onStopLoadingAnimation); } SettingsItem::mouseReleaseEvent(event); }
void CachedTextTrack::data(PassRefPtr<ResourceBuffer> data, bool allDataReceived) { m_data = data; setEncodedSize(m_data.get() ? m_data->size() : 0); CachedResourceClientWalker<CachedResourceClient> walker(m_clients); while (CachedResourceClient *client = walker.next()) client->deprecatedDidReceiveCachedResource(this); if (!allDataReceived) return; setLoading(false); checkNotify(); }
CachedImage::CachedImage(Image* image) : CachedResource(String(), ImageResource) , m_image(image) , m_decodedDataDeletionTimer(this, &CachedImage::decodedDataDeletionTimerFired) , m_shouldPaintBrokenImage(true) , m_autoLoadWasPreventedBySettings(false) { setStatus(Cached); setLoading(false); #if ENABLE(IMPROVE_ANIMATED_GIF_PERFORMANCE) /// M: improve gif animation performance m_visibleScreenRect = IntRect(0 , 0, 0, 0); #endif }
int WallpaperImage::qt_metacall(QMetaObject::Call _c, int _id, void **_a) { typedef bb::cascades::ImageView QMocSuperClass; _id = QMocSuperClass::qt_metacall(_c, _id, _a); if (_id < 0) return _id; if (_c == QMetaObject::InvokeMetaMethod) { if (_id < 13) qt_static_metacall(this, _c, _id, _a); _id -= 13; } #ifndef QT_NO_PROPERTIES else if (_c == QMetaObject::ReadProperty) { void *_v = _a[0]; switch (_id) { case 0: *reinterpret_cast< QUrl*>(_v) = url(); break; case 1: *reinterpret_cast< QString*>(_v) = imageID(); break; case 2: *reinterpret_cast< float*>(_v) = loading(); break; case 3: *reinterpret_cast< QUrl*>(_v) = defaultImage(); break; case 4: *reinterpret_cast< bool*>(_v) = ready(); break; } _id -= 5; } else if (_c == QMetaObject::WriteProperty) { void *_v = _a[0]; switch (_id) { case 0: setUrl(*reinterpret_cast< QUrl*>(_v)); break; case 1: setImageID(*reinterpret_cast< QString*>(_v)); break; case 2: setLoading(*reinterpret_cast< float*>(_v)); break; case 3: setDefaultImage(*reinterpret_cast< QUrl*>(_v)); break; case 4: setReady(*reinterpret_cast< bool*>(_v)); break; } _id -= 5; } else if (_c == QMetaObject::ResetProperty) { _id -= 5; } else if (_c == QMetaObject::QueryPropertyDesignable) { _id -= 5; } else if (_c == QMetaObject::QueryPropertyScriptable) { _id -= 5; } else if (_c == QMetaObject::QueryPropertyStored) { _id -= 5; } else if (_c == QMetaObject::QueryPropertyEditable) { _id -= 5; } else if (_c == QMetaObject::QueryPropertyUser) { _id -= 5; } #endif // QT_NO_PROPERTIES return _id; }
void Resource::error(Resource::Status status) { if (!m_revalidatingRequest.isNull()) m_revalidatingRequest = ResourceRequest(); if (!m_error.isNull() && (m_error.isCancellation() || !isPreloaded())) memoryCache()->remove(this); setStatus(status); ASSERT(errorOccurred()); m_data.clear(); setLoading(false); checkNotify(); markClientsFinished(); }
void CachedResource::stopLoading() { ASSERT(m_loader); m_loader = 0; CachedResourceHandle<CachedResource> protect(this); // All loads finish with finish() or error(), except for // canceled loads, which silently set our request to 0. Be sure to notify our // client in that case, so we don't seem to continue loading forever. if (isLoading()) { setLoading(false); setStatus(LoadError); checkNotify(); } }
result_t BinarySerializeNode::loadFromBuffer ( void* _pData, uint _bufferSize ) { // read raw data m_Capacity = uint(_bufferSize); m_CurPos = 0; if ( m_Capacity > 0 ) { m_pData = ex_malloc( m_Capacity ); ex::mem::cpy( m_pData, _pData, m_Capacity ); } // setLoading (); return EResult::ok; }
void CachedCSSStyleSheet::data(PassRefPtr<SharedBuffer> data, bool allDataReceived) { if (!allDataReceived) return; m_data = data; setEncodedSize(m_data.get() ? m_data->size() : 0); // Decode the data to find out the encoding and keep the sheet text around during checkNotify() if (m_data) { m_decodedSheetText = m_decoder->decode(m_data->data(), m_data->size()); m_decodedSheetText += m_decoder->flush(); } setLoading(false); checkNotify(); // Clear the decoded text as it is unlikely to be needed immediately again and is cheap to regenerate. m_decodedSheetText = String(); }
void SeafileModel::loadDirectory(const QString &path) { QStringList pathList = path.split('/', QString::SkipEmptyParts); clearItems(); setLoading(true); if (pathList.isEmpty()){ // this is a request for the root. ie. the list of libraries. server()->loadLibraries(); this->currentPath=""; } else { QByteArray library = pathList.takeFirst().toUtf8(); QByteArray newPath = pathList.join('/').toUtf8() + '/'; server()->loadDirectory(library, newPath); this->currentPath = newPath; } }