本文整理汇总了C++中CachedImage::setResponse方法的典型用法代码示例。如果您正苦于以下问题:C++ CachedImage::setResponse方法的具体用法?C++ CachedImage::setResponse怎么用?C++ CachedImage::setResponse使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CachedImage
的用法示例。
在下文中一共展示了CachedImage::setResponse方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: finish
void ImageTokenizer::finish()
{
if (!m_parserStopped && m_doc->imageElement()) {
CachedImage* cachedImage = m_doc->cachedImage();
RefPtr<SharedBuffer> data = m_doc->frame()->loader()->documentLoader()->mainResourceData();
// If this is a multipart image, make a copy of the current part, since the resource data
// will be overwritten by the next part.
if (m_doc->frame()->loader()->documentLoader()->isLoadingMultipartContent())
data = data->copy();
cachedImage->data(data.release(), true);
cachedImage->finish();
cachedImage->setResponse(m_doc->frame()->loader()->documentLoader()->response());
IntSize size = cachedImage->imageSize(m_doc->frame()->pageZoomFactor());
if (size.width())
m_doc->setTitle(imageTitle(cachedImage->response().suggestedFilename(), size));
m_doc->imageChanged();
}
m_doc->finishedParsing();
}
示例2: finish
void ImageTokenizer::finish()
{
if (!m_parserStopped && m_doc->imageElement()) {
CachedImage* cachedImage = m_doc->cachedImage();
RefPtr<SharedBuffer> data = m_doc->frame()->loader()->documentLoader()->mainResourceData();
// If this is a multipart image, make a copy of the current part, since the resource data
// will be overwritten by the next part.
if (m_doc->frame()->loader()->documentLoader()->isLoadingMultipartContent())
data = data->copy();
cachedImage->data(data.release(), true);
cachedImage->finish();
cachedImage->setResponse(m_doc->frame()->loader()->documentLoader()->response());
IntSize size = cachedImage->imageSize(pageZoomFactor(m_doc));
if (size.width()) {
// Compute the title, we use the decoded filename of the resource, falling
// back on the (decoded) hostname if there is no path.
String fileName = decodeURLEscapeSequences(m_doc->url().lastPathComponent());
if (fileName.isEmpty())
fileName = m_doc->url().host();
m_doc->setTitle(imageTitle(fileName, size));
}
m_doc->imageChanged();
}
m_doc->finishedParsing();
}
示例3: finish
void ImageDocumentParser::finish()
{
if (!isStopped() && document()->imageElement()) {
CachedImage* cachedImage = document()->cachedImage();
RefPtr<SharedBuffer> data = document()->frame()->loader()->documentLoader()->mainResourceData();
// If this is a multipart image, make a copy of the current part, since the resource data
// will be overwritten by the next part.
if (document()->frame()->loader()->documentLoader()->isLoadingMultipartContent())
data = data->copy();
cachedImage->data(data.release(), true);
cachedImage->finish();
cachedImage->setResponse(document()->frame()->loader()->documentLoader()->response());
// Report the natural image size in the page title, regardless of zoom
// level.
IntSize size = cachedImage->imageSize(1.0f);
if (size.width()) {
// Compute the title, we use the decoded filename of the resource, falling
// back on the (decoded) hostname if there is no path.
String fileName = decodeURLEscapeSequences(document()->url().lastPathComponent());
if (fileName.isEmpty())
fileName = document()->url().host();
document()->setTitle(imageTitle(fileName, size));
}
document()->imageUpdated();
}
document()->finishedParsing();
}