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 eaef68a709decb251b6b26b511a9d2917cef906d..015d0f355d42fa6336de11febcfc1aabcf71ca4f 100644 |
--- a/third_party/WebKit/Source/core/fetch/CSSStyleSheetResource.cpp |
+++ b/third_party/WebKit/Source/core/fetch/CSSStyleSheetResource.cpp |
@@ -28,6 +28,7 @@ |
#include "core/css/StyleSheetContents.h" |
#include "core/fetch/FetchRequest.h" |
+#include "core/fetch/MemoryCache.h" |
#include "core/fetch/ResourceClientWalker.h" |
#include "core/fetch/ResourceFetcher.h" |
#include "core/fetch/StyleSheetResourceClient.h" |
@@ -60,8 +61,6 @@ CSSStyleSheetResource::CSSStyleSheetResource(const ResourceRequest& resourceRequ |
CSSStyleSheetResource::~CSSStyleSheetResource() |
{ |
- // Make sure dispose() was cllaed before destruction. |
- ASSERT(!m_parsedStyleSheetCache); |
} |
void CSSStyleSheetResource::removedFromMemoryCache() |
@@ -180,9 +179,13 @@ void CSSStyleSheetResource::saveParsedStyleSheet(PassRefPtrWillBeRawPtr<StyleShe |
if (m_parsedStyleSheetCache) |
m_parsedStyleSheetCache->removedFromMemoryCache(); |
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 |