本文整理汇总了C++中CachedResourceLoader::decrementRequestCount方法的典型用法代码示例。如果您正苦于以下问题:C++ CachedResourceLoader::decrementRequestCount方法的具体用法?C++ CachedResourceLoader::decrementRequestCount怎么用?C++ CachedResourceLoader::decrementRequestCount使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CachedResourceLoader
的用法示例。
在下文中一共展示了CachedResourceLoader::decrementRequestCount方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: beginLoadTimerFired
void CSSFontSelector::beginLoadTimerFired(Timer<WebCore::CSSFontSelector>*)
{
Vector<CachedResourceHandle<CachedFont> > fontsToBeginLoading;
fontsToBeginLoading.swap(m_fontsToBeginLoading);
CachedResourceLoader* cachedResourceLoader = m_document->cachedResourceLoader();
for (size_t i = 0; i < fontsToBeginLoading.size(); ++i) {
fontsToBeginLoading[i]->beginLoadIfNeeded(cachedResourceLoader);
// Balances incrementRequestCount() in beginLoadingFontSoon().
cachedResourceLoader->decrementRequestCount(fontsToBeginLoading[i].get());
}
// Ensure that if the request count reaches zero, the frame loader will know about it.
cachedResourceLoader->loadDone();
}
示例2: clearDocument
void CSSFontSelector::clearDocument()
{
if (!m_document) {
ASSERT(!m_beginLoadingTimer.isActive());
ASSERT(m_fontsToBeginLoading.isEmpty());
return;
}
m_beginLoadingTimer.stop();
CachedResourceLoader* cachedResourceLoader = m_document->cachedResourceLoader();
for (size_t i = 0; i < m_fontsToBeginLoading.size(); ++i) {
// Balances incrementRequestCount() in beginLoadingFontSoon().
cachedResourceLoader->decrementRequestCount(m_fontsToBeginLoading[i].get());
}
m_fontsToBeginLoading.clear();
m_document = 0;
}
示例3: beginLoadTimerFired
void CSSFontSelector::beginLoadTimerFired(Timer<WebCore::CSSFontSelector>*)
{
Vector<CachedResourceHandle<CachedFont> > fontsToBeginLoading;
fontsToBeginLoading.swap(m_fontsToBeginLoading);
// CSSFontSelector could get deleted via beginLoadIfNeeded() or loadDone() unless protected.
RefPtr<CSSFontSelector> protect(this);
CachedResourceLoader* cachedResourceLoader = m_document->cachedResourceLoader();
for (size_t i = 0; i < fontsToBeginLoading.size(); ++i) {
fontsToBeginLoading[i]->beginLoadIfNeeded(cachedResourceLoader);
// Balances incrementRequestCount() in beginLoadingFontSoon().
cachedResourceLoader->decrementRequestCount(fontsToBeginLoading[i].get());
}
// Ensure that if the request count reaches zero, the frame loader will know about it.
cachedResourceLoader->loadDone();
// New font loads may be triggered by layout after the document load is complete but before we have dispatched
// didFinishLoading for the frame. Make sure the delegate is always dispatched by checking explicitly.
if (m_document && m_document->frame())
m_document->frame()->loader()->checkLoadComplete();
}