• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ setEncodedSize函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中setEncodedSize函数的典型用法代码示例。如果您正苦于以下问题:C++ setEncodedSize函数的具体用法?C++ setEncodedSize怎么用?C++ setEncodedSize使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



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

示例1: destroyDecodedData

void CachedImage::clear()
{
    destroyDecodedData();
    clearImage();
    m_pendingContainerSizeRequests.clear();
    setEncodedSize(0);
}
开发者ID:rhythmkay,项目名称:webkit,代码行数:7,代码来源:CachedImage.cpp


示例2: createImage

void CachedImage::addIncrementalDataBuffer(SharedBuffer& data)
{
    m_data = &data;

    createImage();

    // Have the image update its data from its internal buffer.
    // It will not do anything now, but will delay decoding until
    // queried for info (like size or specific image frames).
    bool sizeAvailable = m_image->setData(&data, false);
    if (!sizeAvailable)
        return;

    if (m_image->isNull()) {
        // Image decoding failed. Either we need more image data or the image data is malformed.
        error(errorOccurred() ? status() : DecodeError);
        if (inCache())
            MemoryCache::singleton().remove(*this);
        return;
    }

    // Tell our observers to try to draw.
    // Each chunk from the network causes observers to repaint, which will force that chunk to decode.
    // It would be nice to only redraw the decoded band of the image, but with the current design
    // (decoding delayed until painting) that seems hard.
    notifyObservers();

    setEncodedSize(m_image->data() ? m_image->data()->size() : 0);
}
开发者ID:rhythmkay,项目名称:webkit,代码行数:29,代码来源:CachedImage.cpp


示例3: setEncodedSize

void CachedRawResource::clear()
{
    m_data = nullptr;
    setEncodedSize(0);
    if (m_loader)
        m_loader->clearResourceData();
}
开发者ID:rodrigo-speller,项目名称:webkit,代码行数:7,代码来源:CachedRawResource.cpp


示例4: prune

void ImageResource::clear()
{
    prune();
    clearImage();
    m_pendingContainerSizeRequests.clear();
    setEncodedSize(0);
}
开发者ID:kingysu,项目名称:blink-crosswalk,代码行数:7,代码来源:ImageResource.cpp


示例5: ASSERT

void Resource::setResourceBuffer(PassRefPtr<SharedBuffer> resourceBuffer)
{
    ASSERT(m_revalidatingRequest.isNull());
    ASSERT(!errorOccurred());
    ASSERT(m_options.dataBufferingPolicy == BufferData);
    m_data = resourceBuffer;
    setEncodedSize(m_data->size());
}
开发者ID:golden628,项目名称:ChromiumGStreamerBackend,代码行数:8,代码来源:Resource.cpp


示例6: setEncodedSize

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();
}
开发者ID:clbr,项目名称:webkitfltk,代码行数:9,代码来源:CachedXSLStyleSheet.cpp


示例7: setEncodedSize

void CachedXSLStyleSheet::data(Vector<char>& data, bool allDataReceived)
{
    if (!allDataReceived)
        return;

    setEncodedSize(data.size());
    m_sheet = String(m_decoder->decode(data.data(), encodedSize()));
    m_loading = false;
    checkNotify();
}
开发者ID:oroisec,项目名称:ios,代码行数:10,代码来源:CachedXSLStyleSheet.cpp


示例8: ASSERT

void CachedTextTrack::updateData(SharedBuffer* data)
{
    ASSERT(dataBufferingPolicy() == BufferData);
    m_data = data;
    setEncodedSize(data ? data->size() : 0);

    CachedResourceClientWalker<CachedResourceClient> walker(m_clients);
    while (CachedResourceClient* client = walker.next())
        client->deprecatedDidReceiveCachedResource(this);
}
开发者ID:clbr,项目名称:webkitfltk,代码行数:10,代码来源:CachedTextTrack.cpp


示例9: setEncodedSize

void CachedResource::appendData(const char* data, int length)
{
    if (m_options.dataBufferingPolicy == DoNotBufferData)
        return;
    if (m_data)
        m_data->append(data, length);
    else
        m_data = SharedBuffer::create(data, length);
    setEncodedSize(m_data->size());
}
开发者ID:Channely,项目名称:know-your-chrome,代码行数:10,代码来源:CachedResource.cpp


示例10: setEncodedSize

void CachedFont::data(PassRefPtr<SharedBuffer> data, bool allDataReceived)
{
    if (!allDataReceived)
        return;

    m_data = data;     
    setEncodedSize(m_data.get() ? m_data->size() : 0);
    m_loading = false;
    checkNotify();
}
开发者ID:325116067,项目名称:semc-qsd8x50,代码行数:10,代码来源:CachedFont.cpp


示例11: setEncodedSize

void CachedScript::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_script = m_encoding.decode(m_data->data(), encodedSize());
    m_loading = false;
    checkNotify();
}
开发者ID:FilipBE,项目名称:qtextended,代码行数:12,代码来源:CachedScript.cpp


示例12: TRACE_EVENT0

void Resource::appendData(const char* data, size_t length)
{
    TRACE_EVENT0("blink", "Resource::appendData");
    ASSERT(m_revalidatingRequest.isNull());
    ASSERT(!errorOccurred());
    if (m_options.dataBufferingPolicy == DoNotBufferData)
        return;
    if (m_data)
        m_data->append(data, length);
    else
        m_data = SharedBuffer::createPurgeable(data, length);
    setEncodedSize(m_data->size());
}
开发者ID:golden628,项目名称:ChromiumGStreamerBackend,代码行数:13,代码来源:Resource.cpp


示例13: setEncodedSize

void CachedXSLStyleSheet::data(PassRefPtr<ResourceBuffer> data, bool allDataReceived)
{
    if (!allDataReceived)
        return;

    m_data = data;     
    setEncodedSize(m_data.get() ? m_data->size() : 0);
    if (m_data.get()) {
        m_sheet = m_decoder->decode(m_data->data(), encodedSize());
        m_sheet.append(m_decoder->flush());
    }
    setLoading(false);
    checkNotify();
}
开发者ID:166MMX,项目名称:openjdk.java.net-openjfx-8u40-rt,代码行数:14,代码来源:CachedXSLStyleSheet.cpp


示例14: setEncodedSize

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();
    }
    m_loading = false;
    checkNotify();
}
开发者ID:Gin-Rye,项目名称:duibrowser,代码行数:14,代码来源:CachedXSLStyleSheet.cpp


示例15: setEncodedSize

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();
}
开发者ID:SchleunigerAG,项目名称:WinEC7_Qt5.3.1_Fixes,代码行数:14,代码来源:CachedCSSStyleSheet.cpp


示例16: setEncodedSize

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();
}
开发者ID:Anthony-Biget,项目名称:openjfx,代码行数:15,代码来源:CachedTextTrack.cpp


示例17: protect

void CachedRawResource::addDataBuffer(ResourceBuffer* data)
{
    CachedResourceHandle<CachedRawResource> protect(this);
    ASSERT(m_options.dataBufferingPolicy() == BufferData);
    m_data = data;

    unsigned incrementalDataLength;
    const char* incrementalData = calculateIncrementalDataChunk(data, incrementalDataLength);
    if (data)
        setEncodedSize(data->size());
    notifyClientsDataWasReceived(incrementalData, incrementalDataLength);
    if (m_options.dataBufferingPolicy() == DoNotBufferData) {
        if (m_loader)
            m_loader->setDataBufferingPolicy(DoNotBufferData);
        clear();
    }
}
开发者ID:CannedFish,项目名称:webkit,代码行数:17,代码来源:CachedRawResource.cpp


示例18: ASSERT

const String& ScriptResource::script()
{
    ASSERT(!isPurgeable());
    ASSERT(isLoaded());

    if (!m_script && m_data) {
        String script = decodedText();
        m_data.clear();
        // We lie a it here and claim that script counts as encoded data (even though it's really decoded data).
        // That's because the MemoryCache thinks that it can clear out decoded data by calling destroyDecodedData(),
        // but we can't destroy script in destroyDecodedData because that's our only copy of the data!
        setEncodedSize(script.sizeInBytes());
        m_script = AtomicString(script);
    }

    return m_script.string();
}
开发者ID:JiangSuyong,项目名称:chromium,代码行数:17,代码来源:ScriptResource.cpp


示例19: setEncodedSize

void CachedCSSStyleSheet::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 = m_decoder->decode(m_data->data(), encodedSize());
        m_sheet += m_decoder->flush();
#if ENABLE(DIVIDE_PAGES)
		int blockCenterPos = m_sheet.find("display:block;text-align:center", 0, false);
		if (-1 != blockCenterPos)
			m_sheet.insert("margin-left: auto;margin-right: auto;", blockCenterPos);
#endif
    }
    m_loading = false;
    checkNotify();
}
开发者ID:chushuai,项目名称:DuiBrowser,代码行数:19,代码来源:CachedCSSStyleSheet.cpp


示例20: protectedThis

void CachedRawResource::addDataBuffer(SharedBuffer& data)
{
    CachedResourceHandle<CachedRawResource> protectedThis(this);
    ASSERT(dataBufferingPolicy() == BufferData);
    m_data = &data;

    unsigned incrementalDataLength;
    const char* incrementalData = calculateIncrementalDataChunk(&data, incrementalDataLength);
    setEncodedSize(data.size());
    notifyClientsDataWasReceived(incrementalData, incrementalDataLength);
    if (dataBufferingPolicy() == DoNotBufferData) {
        if (m_loader)
            m_loader->setDataBufferingPolicy(DoNotBufferData);
        clear();
        return;
    }

    CachedResource::addDataBuffer(data);
}
开发者ID:eocanha,项目名称:webkit,代码行数:19,代码来源:CachedRawResource.cpp



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ setEncoding函数代码示例发布时间:2022-05-30
下一篇:
C++ setEnabled函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap