本文整理汇总了C++中setEncodedSize函数的典型用法代码示例。如果您正苦于以下问题:C++ setEncodedSize函数的具体用法?C++ setEncodedSize怎么用?C++ setEncodedSize使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了setEncodedSize函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: destroyDecodedData
void CachedImage::clear()
{
destroyDecodedData();
clearImage();
m_pendingContainerSizeRequests.clear();
setEncodedSize(0);
}
示例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);
}
示例3: setEncodedSize
void CachedRawResource::clear()
{
m_data = nullptr;
setEncodedSize(0);
if (m_loader)
m_loader->clearResourceData();
}
示例4: prune
void ImageResource::clear()
{
prune();
clearImage();
m_pendingContainerSizeRequests.clear();
setEncodedSize(0);
}
示例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());
}
示例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();
}
示例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();
}
示例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);
}
示例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());
}
示例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();
}
示例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();
}
示例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());
}
示例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();
}
示例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();
}
示例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();
}