Remove hasFailedOrCanceledSubresources.

This was used to skip caching sheets across documents that had failed
resource loads so that when you loaded a new tab with the same resource
we'd attempt to load it again.

The cross document cache (which was only used by <link>) doesn't exist
in Sky, and neither does CSSStyleSheetResource which used it, so we can
remove all this code.

R=ojan@chromium.org

Review URL: https://codereview.chromium.org/799113003
This commit is contained in:
Elliott Sprehn 2014-12-12 15:41:52 -08:00
parent 15f795fcc3
commit 3bccf6139d
16 changed files with 0 additions and 122 deletions

View File

@ -202,15 +202,6 @@ void CSSCrossfadeValue::CrossfadeSubimageObserverProxy::imageChanged(ImageResour
m_ownerValue->crossfadeChanged(*rect);
}
bool CSSCrossfadeValue::hasFailedOrCanceledSubresources() const
{
if (m_cachedFromImage && m_cachedFromImage->loadFailedOrCanceled())
return true;
if (m_cachedToImage && m_cachedToImage->loadFailedOrCanceled())
return true;
return false;
}
bool CSSCrossfadeValue::equals(const CSSCrossfadeValue& other) const
{
return compareCSSValuePtr(m_fromValue, other.m_fromValue)

View File

@ -63,8 +63,6 @@ public:
void setPercentage(PassRefPtr<CSSPrimitiveValue> percentageValue) { m_percentageValue = percentageValue; }
bool hasFailedOrCanceledSubresources() const;
bool equals(const CSSCrossfadeValue&) const;
private:

View File

@ -75,13 +75,6 @@ String CSSFontFaceSrcValue::customCSSText() const
return result.toString();
}
bool CSSFontFaceSrcValue::hasFailedOrCanceledSubresources() const
{
if (!m_fetched)
return false;
return m_fetched->loadFailedOrCanceled();
}
FontResource* CSSFontFaceSrcValue::fetch(Document* document)
{
if (!m_fetched) {

View File

@ -60,8 +60,6 @@ public:
String customCSSText() const;
bool hasFailedOrCanceledSubresources() const;
FontResource* fetch(Document*);
bool equals(const CSSFontFaceSrcValue&) const;

View File

@ -164,15 +164,6 @@ String CSSImageSetValue::customCSSText() const
return result.toString();
}
bool CSSImageSetValue::hasFailedOrCanceledSubresources() const
{
if (!m_imageSet || !m_imageSet->isImageResourceSet())
return false;
if (Resource* cachedResource = toStyleFetchedImageSet(m_imageSet)->cachedImage())
return cachedResource->loadFailedOrCanceled();
return true;
}
CSSImageSetValue::CSSImageSetValue(const CSSImageSetValue& cloneFrom)
: CSSValueList(cloneFrom)
, m_accessedBestFitImage(false)

View File

@ -61,8 +61,6 @@ public:
float scaleFactor;
};
bool hasFailedOrCanceledSubresources() const;
PassRefPtr<CSSImageSetValue> cloneForCSSOM() const;
protected:

View File

@ -85,15 +85,6 @@ void CSSImageValue::restoreCachedResourceIfNeeded(Document& document)
document.fetcher()->requestLoadStarted(resource, request, ResourceFetcher::ResourceLoadingFromCache);
}
bool CSSImageValue::hasFailedOrCanceledSubresources() const
{
if (!m_image || !m_image->isImageResource())
return false;
if (Resource* cachedResource = toStyleFetchedImage(m_image)->cachedImage())
return cachedResource->loadFailedOrCanceled();
return true;
}
bool CSSImageValue::equals(const CSSImageValue& other) const
{
return m_absoluteURL == other.m_absoluteURL;

View File

@ -63,8 +63,6 @@ public:
PassRefPtr<CSSValue> cloneForCSSOM() const;
bool hasFailedOrCanceledSubresources() const;
bool equals(const CSSImageValue&) const;
bool knownToBeOpaque(const RenderObject*) const;

View File

@ -100,25 +100,6 @@ CSSValue::Type CSSValue::cssValueType() const
return CSS_CUSTOM;
}
bool CSSValue::hasFailedOrCanceledSubresources() const
{
// This should get called for internal instances only.
ASSERT(!isCSSOMSafe());
if (isValueList())
return toCSSValueList(this)->hasFailedOrCanceledSubresources();
if (classType() == FontFaceSrcClass)
return toCSSFontFaceSrcValue(this)->hasFailedOrCanceledSubresources();
if (classType() == ImageClass)
return toCSSImageValue(this)->hasFailedOrCanceledSubresources();
if (classType() == CrossfadeClass)
return toCSSCrossfadeValue(this)->hasFailedOrCanceledSubresources();
if (classType() == ImageSetClass)
return toCSSImageSetValue(this)->hasFailedOrCanceledSubresources();
return false;
}
template<class ChildClassType>
inline static bool compareCSSValues(const CSSValue& first, const CSSValue& second)
{

View File

@ -111,8 +111,6 @@ public:
PassRefPtr<CSSValue> cloneForCSSOM() const;
bool hasFailedOrCanceledSubresources() const;
bool equals(const CSSValue&) const;
protected:

View File

@ -128,15 +128,6 @@ bool CSSValueList::equals(const CSSValue& other) const
return value && value->equals(other);
}
bool CSSValueList::hasFailedOrCanceledSubresources() const
{
for (unsigned i = 0; i < m_values.size(); ++i) {
if (m_values[i]->hasFailedOrCanceledSubresources())
return true;
}
return false;
}
CSSValueList::CSSValueList(const CSSValueList& cloneFrom)
: CSSValue(cloneFrom.classType(), /* isCSSOMSafe */ true)
{

View File

@ -57,8 +57,6 @@ public:
bool equals(const CSSValueList&) const;
bool equals(const CSSValue&) const;
bool hasFailedOrCanceledSubresources() const;
PassRefPtr<CSSValueList> cloneForCSSOM() const;
protected:

View File

@ -297,16 +297,6 @@ String StylePropertySet::asText() const
return StylePropertySerializer(*this).asText();
}
bool StylePropertySet::hasFailedOrCanceledSubresources() const
{
unsigned size = propertyCount();
for (unsigned i = 0; i < size; ++i) {
if (propertyAt(i).value()->hasFailedOrCanceledSubresources())
return true;
}
return false;
}
// This is the list of properties we want to copy in the copyBlockProperties() function.
// It is the list of CSS properties that apply specially to block-level elements.
static const CSSPropertyID staticBlockProperties[] = {

View File

@ -108,8 +108,6 @@ public:
bool isMutable() const { return m_isMutable; }
bool hasFailedOrCanceledSubresources() const;
static unsigned averageSizeInBytes();
#ifndef NDEBUG

View File

@ -142,40 +142,6 @@ KURL StyleSheetContents::completeURL(const String& url) const
return m_parserContext.completeURL(url);
}
static bool childRulesHaveFailedOrCanceledSubresources(const Vector<RefPtr<StyleRuleBase> >& rules)
{
for (unsigned i = 0; i < rules.size(); ++i) {
const StyleRuleBase* rule = rules[i].get();
switch (rule->type()) {
case StyleRuleBase::Style:
if (toStyleRule(rule)->properties().hasFailedOrCanceledSubresources())
return true;
break;
case StyleRuleBase::FontFace:
if (toStyleRuleFontFace(rule)->properties().hasFailedOrCanceledSubresources())
return true;
break;
case StyleRuleBase::Media:
if (childRulesHaveFailedOrCanceledSubresources(toStyleRuleMedia(rule)->childRules()))
return true;
break;
case StyleRuleBase::Keyframes:
case StyleRuleBase::Unknown:
case StyleRuleBase::Keyframe:
case StyleRuleBase::Supports:
case StyleRuleBase::Filter:
break;
}
}
return false;
}
bool StyleSheetContents::hasFailedOrCanceledSubresources() const
{
ASSERT(isCacheable());
return childRulesHaveFailedOrCanceledSubresources(m_childRules);
}
Document* StyleSheetContents::clientSingleOwnerDocument() const
{
if (!m_hasSingleOwnerDocument || clientSize() <= 0)

View File

@ -65,8 +65,6 @@ public:
Node* singleOwnerNode() const;
Document* singleOwnerDocument() const;
bool hasFailedOrCanceledSubresources() const;
KURL completeURL(const String& url) const;
void setHasSyntacticallyValidCSSHeader(bool isValidCss);