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


C++ ImageResource::setResponse方法代码示例

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


在下文中一共展示了ImageResource::setResponse方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: finish

void ImageDocumentParser::finish()
{
    if (!isStopped() && document()->imageElement() && document()->cachedImage()) {
        ImageResource* cachedImage = document()->cachedImage();
        DocumentLoader* loader = document()->loader();
        cachedImage->setResponse(loader->response());
        cachedImage->setLoadFinishTime(loader->timing().responseEnd());
        cachedImage->finish();

        // Report the natural image size in the page title, regardless of zoom level.
        // At a zoom level of 1 the image is guaranteed to have an integer size.
        IntSize size = flooredIntSize(cachedImage->imageSizeForLayoutObject(document()->imageElement()->layoutObject(), 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();
    }

    // TODO(esprehn): These null checks on Document don't make sense, document()
    // will ASSERT if it was null. Do these want to check isDetached() ?
    if (document())
        document()->finishedParsing();
}
开发者ID:JulienIsorce,项目名称:ChromiumGStreamerBackend,代码行数:29,代码来源:ImageDocument.cpp

示例2: finish

void ImageDocumentParser::finish()
{
    if (!isStopped() && document()->imageElement() && document()->cachedImage()) {
        ImageResource* cachedImage = document()->cachedImage();
        cachedImage->finish();
        cachedImage->setResponse(document()->frame()->loader().documentLoader()->response());

        // Report the natural image size in the page title, regardless of zoom level.
        // At a zoom level of 1 the image is guaranteed to have an integer size.
        IntSize size = flooredIntSize(cachedImage->imageSizeForLayoutObject(document()->imageElement()->layoutObject(), 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();
    }

    if (document())
        document()->finishedParsing();
}
开发者ID:alexanderbill,项目名称:blink-crosswalk,代码行数:25,代码来源:ImageDocument.cpp


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