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

Unified Diff: third_party/WebKit/Source/core/fetch/CSSStyleSheetResource.cpp

Issue 1782473002: Check if stylesheet resource was cached before marking it as such. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix non-oilpan compilation Created 4 years, 9 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/StyleSheetContents.cpp ('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/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
« no previous file with comments | « third_party/WebKit/Source/core/css/StyleSheetContents.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698