Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(915)

Unified Diff: third_party/WebKit/Source/core/css/CSSImageValue.cpp

Issue 2296083003: Refactoring: Remove CSSImageValue::m_isCachePending (Closed)
Patch Set: Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/Source/core/css/CSSImageValue.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/css/CSSImageValue.cpp
diff --git a/third_party/WebKit/Source/core/css/CSSImageValue.cpp b/third_party/WebKit/Source/core/css/CSSImageValue.cpp
index 059d7460a5e6c26b961dc4cf79fc2775e15415bc..1fcf9aa859d5e9799847960d0ee452137a001297 100644
--- a/third_party/WebKit/Source/core/css/CSSImageValue.cpp
+++ b/third_party/WebKit/Source/core/css/CSSImageValue.cpp
@@ -39,7 +39,6 @@ CSSImageValue::CSSImageValue(const AtomicString& rawValue, const KURL& url, Styl
: CSSValue(ImageClass)
, m_relativeURL(rawValue)
, m_absoluteURL(url.getString())
- , m_isCachePending(!image)
, m_cachedImage(image)
{
}
@@ -48,7 +47,6 @@ CSSImageValue::CSSImageValue(const AtomicString& absoluteURL)
: CSSValue(ImageClass)
, m_relativeURL(absoluteURL)
, m_absoluteURL(absoluteURL)
- , m_isCachePending(true)
{
}
@@ -60,9 +58,7 @@ StyleImage* CSSImageValue::cacheImage(Document* document, CrossOriginAttributeVa
{
ASSERT(document);
- if (m_isCachePending) {
- m_isCachePending = false;
-
+ if (!m_cachedImage) {
FetchRequest request(ResourceRequest(m_absoluteURL), m_initiatorName.isEmpty() ? FetchInitiatorTypeNames::css : m_initiatorName);
request.mutableResourceRequest().setHTTPReferrer(SecurityPolicy::generateReferrer(m_referrer.referrerPolicy, request.url(), m_referrer.referrer));
@@ -80,7 +76,7 @@ StyleImage* CSSImageValue::cacheImage(Document* document, CrossOriginAttributeVa
void CSSImageValue::restoreCachedResourceIfNeeded(Document& document) const
{
- if (m_isCachePending || !m_cachedImage || !document.fetcher() || m_absoluteURL.isNull())
+ if (!m_cachedImage || !document.fetcher() || m_absoluteURL.isNull())
return;
if (document.fetcher()->cachedResource(KURL(ParsedURLString, m_absoluteURL)))
return;
@@ -133,7 +129,6 @@ void CSSImageValue::reResolveURL(const Document& document) const
if (urlString == m_absoluteURL)
return;
m_absoluteURL = urlString;
- m_isCachePending = true;
m_cachedImage.clear();
}
« no previous file with comments | « third_party/WebKit/Source/core/css/CSSImageValue.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698