本文整理汇总了C++中CachedImage::stillNeedsLoad方法的典型用法代码示例。如果您正苦于以下问题:C++ CachedImage::stillNeedsLoad方法的具体用法?C++ CachedImage::stillNeedsLoad怎么用?C++ CachedImage::stillNeedsLoad使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CachedImage
的用法示例。
在下文中一共展示了CachedImage::stillNeedsLoad方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: requestImage
CachedImage* CachedResourceLoader::requestImage(ResourceRequest& request)
{
if (Frame* f = frame()) {
Settings* settings = f->settings();
if (!f->loader()->client()->allowImages(!settings || settings->areImagesEnabled()))
return 0;
if (f->loader()->pageDismissalEventBeingDispatched()) {
KURL requestURL = request.url();
if (requestURL.isValid() && canRequest(CachedResource::ImageResource, requestURL))
PingLoader::loadImage(f, requestURL);
return 0;
}
}
CachedImage* resource = static_cast<CachedImage*>(requestResource(CachedResource::ImageResource, request, String()));
if (resource) {
#ifdef ANDROID_BLOCK_NETWORK_IMAGE
resource->setAutoLoadWasPreventedBySettings(!autoLoadImages() || shouldBlockNetworkImage(request.url()));
#else
resource->setAutoLoadWasPreventedBySettings(!autoLoadImages());
#endif
if (autoLoadImages() && resource->stillNeedsLoad()) {
#ifdef ANDROID_BLOCK_NETWORK_IMAGE
if (shouldBlockNetworkImage(request.url())) {
return resource;
}
#endif
resource->setLoading(true);
load(resource, true);
}
}
return resource;
}
示例2: setAutoLoadImages
void DocLoader::setAutoLoadImages(bool enable)
{
if (enable == m_autoLoadImages)
return;
m_autoLoadImages = enable;
if (!m_autoLoadImages)
return;
DocumentResourceMap::iterator end = m_documentResources.end();
for (DocumentResourceMap::iterator it = m_documentResources.begin(); it != end; ++it) {
CachedResource* resource = it->second.get();
if (resource->type() == CachedResource::ImageResource) {
CachedImage* image = const_cast<CachedImage*>(static_cast<const CachedImage*>(resource));
#ifdef ANDROID_BLOCK_NETWORK_IMAGE
if (shouldBlockNetworkImage(image->url()))
continue;
#endif
if (image->stillNeedsLoad())
cache()->loader()->load(this, image, true);
}
}
}
示例3: requestImage
CachedImage* DocLoader::requestImage(const String& url)
{
CachedImage* resource = static_cast<CachedImage*>(requestResource(CachedResource::ImageResource, url, String()));
if (autoLoadImages() && resource && resource->stillNeedsLoad()) {
resource->setLoading(true);
cache()->loader()->load(this, resource, true);
}
return resource;
}
示例4: requestImage
CachedImage* DocLoader::requestImage(const String& url)
{
if (Frame* f = frame()) {
Settings* settings = f->settings();
if (!f->loader()->client()->allowImages(!settings || settings->areImagesEnabled()))
return 0;
}
CachedImage* resource = static_cast<CachedImage*>(requestResource(CachedResource::ImageResource, url, String()));
if (autoLoadImages() && resource && resource->stillNeedsLoad()) {
resource->setLoading(true);
cache()->loader()->load(this, resource, true);
}
return resource;
}
示例5: requestImage
CachedImage* CachedResourceLoader::requestImage(ResourceRequest& request)
{
if (Frame* f = frame()) {
Settings* settings = f->settings();
if (!f->loader()->client()->allowImages(!settings || settings->areImagesEnabled()))
return 0;
if (f->loader()->pageDismissalEventBeingDispatched() != FrameLoader::NoDismissal) {
KURL requestURL = request.url();
if (requestURL.isValid() && canRequest(CachedResource::ImageResource, requestURL))
PingLoader::loadImage(f, requestURL);
return 0;
}
}
CachedImage* resource = static_cast<CachedImage*>(requestResource(CachedResource::ImageResource, request, String()));
if (autoLoadImages() && resource && resource->stillNeedsLoad())
resource->load(this);
return resource;
}
示例6: requestImage
CachedImage* DocLoader::requestImage(const String& url)
{
if (Frame* f = frame()) {
Settings* settings = f->settings();
if (!f->loader()->client()->allowImages(!settings || settings->areImagesEnabled()))
return 0;
}
CachedImage* resource = static_cast<CachedImage*>(requestResource(CachedResource::ImageResource, url, String()));
if (autoLoadImages() && resource && resource->stillNeedsLoad()) {
#ifdef ANDROID_BLOCK_NETWORK_IMAGE
if (shouldBlockNetworkImage(url)) {
return resource;
}
#endif
resource->setLoading(true);
cache()->loader()->load(this, resource, true);
}
return resource;
}
示例7: setBlockNetworkImage
void DocLoader::setBlockNetworkImage(bool block)
{
if (block == m_blockNetworkImage)
return;
m_blockNetworkImage = block;
if (!m_autoLoadImages || m_blockNetworkImage)
return;
DocumentResourceMap::iterator end = m_documentResources.end();
for (DocumentResourceMap::iterator it = m_documentResources.begin(); it != end; ++it) {
CachedResource* resource = it->second.get();
if (resource->type() == CachedResource::ImageResource) {
CachedImage* image = const_cast<CachedImage*>(static_cast<const CachedImage*>(resource));
if (image->stillNeedsLoad())
cache()->loader()->load(this, image, true);
}
}
}
示例8: setAutoLoadImages
void CachedResourceLoader::setAutoLoadImages(bool enable)
{
if (enable == m_autoLoadImages)
return;
m_autoLoadImages = enable;
if (!m_autoLoadImages)
return;
DocumentResourceMap::iterator end = m_documentResources.end();
for (DocumentResourceMap::iterator it = m_documentResources.begin(); it != end; ++it) {
CachedResource* resource = it->second.get();
if (resource->type() == CachedResource::ImageResource) {
CachedImage* image = const_cast<CachedImage*>(static_cast<const CachedImage*>(resource));
if (image->stillNeedsLoad())
image->load(this, defaultCachedResourceOptions());
}
}
}
示例9: requestImage
CachedImage* CachedResourceLoader::requestImage(const String& url)
{
if (Frame* f = frame()) {
Settings* settings = f->settings();
if (!f->loader()->client()->allowImages(!settings || settings->areImagesEnabled()))
return 0;
if (f->loader()->pageDismissalEventBeingDispatched()) {
KURL completeURL = m_document->completeURL(url);
if (completeURL.isValid() && canRequest(CachedResource::ImageResource, completeURL))
PingLoader::loadImage(f, completeURL);
return 0;
}
}
CachedImage* resource = static_cast<CachedImage*>(requestResource(CachedResource::ImageResource, url, String()));
if (autoLoadImages() && resource && resource->stillNeedsLoad()) {
resource->setLoading(true);
load(resource, true);
}
return resource;
}
示例10: setAutoLoadImages
void DocLoader::setAutoLoadImages(bool enable)
{
if (enable == m_autoLoadImages)
return;
m_autoLoadImages = enable;
if (!m_autoLoadImages)
return;
SubCache::ResourceMap resources = m_documentResources.allResources();
SubCache::ResourceMap::iterator end = resources.end();
for(SubCache::ResourceMap::iterator it = resources.begin(); it != end; ++it) {
CachedResource* resource = it->second.get();
if (resource->type() == CachedResource::ImageResource) {
CachedImage* image = const_cast<CachedImage*>(static_cast<const CachedImage*>(resource));
if (image->stillNeedsLoad())
cache()->loader()->load(this, image, true);
}
}
}
示例11: setBlockNetworkImage
void CachedResourceLoader::setBlockNetworkImage(bool block)
{
if (block == m_blockNetworkImage)
return;
m_blockNetworkImage = block;
if (!m_autoLoadImages || m_blockNetworkImage)
return;
DocumentResourceMap::iterator end = m_documentResources.end();
for (DocumentResourceMap::iterator it = m_documentResources.begin(); it != end; ++it) {
CachedResource* resource = it->second.get();
if (resource->type() == CachedResource::ImageResource) {
CachedImage* image = const_cast<CachedImage*>(static_cast<const CachedImage*>(resource));
image->setAutoLoadWasPreventedBySettings(false);
if (image->stillNeedsLoad()) {
image->setLoading(true);
load(image, true);
}
}
}
}