Index: third_party/WebKit/Source/core/fetch/CSSStyleSheetResource.cpp |
diff --git a/third_party/WebKit/Source/core/fetch/CSSStyleSheetResource.cpp b/third_party/WebKit/Source/core/fetch/CSSStyleSheetResource.cpp |
index 78ebcd9928613cb4efdb798cef7753d0910e510b..c69e1882e0ad1b48cf7d93349660de1fde03ec3c 100644 |
--- a/third_party/WebKit/Source/core/fetch/CSSStyleSheetResource.cpp |
+++ b/third_party/WebKit/Source/core/fetch/CSSStyleSheetResource.cpp |
@@ -185,14 +185,17 @@ void CSSStyleSheetResource::saveParsedStyleSheet(StyleSheetContents* sheet) |
if (m_parsedStyleSheetCache) |
m_parsedStyleSheetCache->removedFromMemoryCache(); |
+ |
+ if (!memoryCache()->contains(this)) { |
+ // This stylesheet resource did conflict with another resource and was |
+ // not added to the cache. |
+ m_parsedStyleSheetCache = nullptr; |
+ return; |
+ } |
m_parsedStyleSheetCache = sheet; |
+ m_parsedStyleSheetCache->addedToMemoryCache(); |
setDecodedSize(m_parsedStyleSheetCache->estimatedSizeInBytes()); |
- |
- // Check if this stylesheet resource didn't conflict with |
- // another resource and has indeed been added to the cache. |
- if (memoryCache()->contains(this)) |
- m_parsedStyleSheetCache->addedToMemoryCache(); |
} |
} // namespace blink |