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

Unified Diff: Source/core/fetch/Resource.cpp

Issue 217643003: Revert of MemoryCache: make sure that Resources are evicted only when they can be deleted (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 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 | « Source/core/fetch/Resource.h ('k') | Source/core/fetch/ResourceFetcher.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/fetch/Resource.cpp
diff --git a/Source/core/fetch/Resource.cpp b/Source/core/fetch/Resource.cpp
index a58d4e3819ecf82bf45a6d62c936a9f4f387ce1a..8de53059160fd0e7cf8cb2198f29297b80c8bb0f 100644
--- a/Source/core/fetch/Resource.cpp
+++ b/Source/core/fetch/Resource.cpp
@@ -364,11 +364,6 @@
return true;
}
-bool Resource::hasRightHandleCountApartFromCache(unsigned targetCount) const
-{
- return m_handleCount == targetCount + memoryCache()->contains(this);
-}
-
void Resource::responseReceived(const ResourceResponse& response)
{
setResponse(response);
@@ -406,17 +401,6 @@
m_cachedMetadata = CachedMetadata::create(dataTypeID, data, size);
const Vector<char>& serializedData = m_cachedMetadata->serialize();
blink::Platform::current()->cacheMetadata(m_response.url(), m_response.responseTime(), serializedData.data(), serializedData.size());
-}
-
-bool Resource::canDelete() const
-{
- return !hasClients() && !m_loader && !m_preloadCount && hasRightHandleCountApartFromCache(0)
- && !m_protectorCount && !m_resourceToRevalidate && !m_proxyResource;
-}
-
-bool Resource::hasOneHandleApartFromCache() const
-{
- return hasRightHandleCountApartFromCache(1);
}
CachedMetadata* Resource::cachedMetadata(unsigned dataTypeID) const
@@ -787,8 +771,6 @@
unlock();
} else if (m_handleCount == 1 && memoryCache()->contains(this)) {
unlock();
- if (!hasClients())
- memoryCache()->prune(this);
}
}
« no previous file with comments | « Source/core/fetch/Resource.h ('k') | Source/core/fetch/ResourceFetcher.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698