当前位置: 首页>>代码示例>>C++>>正文


C++ CachedImage::finish方法代码示例

本文整理汇总了C++中CachedImage::finish方法的典型用法代码示例。如果您正苦于以下问题:C++ CachedImage::finish方法的具体用法?C++ CachedImage::finish怎么用?C++ CachedImage::finish使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CachedImage的用法示例。


在下文中一共展示了CachedImage::finish方法的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();
}
开发者ID:Gin-Rye,项目名称:duibrowser,代码行数:25,代码来源:ImageDocument.cpp

示例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();
}
开发者ID:mikedougherty,项目名称:webkit,代码行数:31,代码来源:ImageDocument.cpp

示例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();
}
开发者ID:ricardo-quesada,项目名称:Webkit-Projects,代码行数:33,代码来源:ImageDocument.cpp


注:本文中的CachedImage::finish方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。