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

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

Issue 179943002: 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: Pruning when handle count reaches 1 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
Index: Source/core/fetch/Resource.h
diff --git a/Source/core/fetch/Resource.h b/Source/core/fetch/Resource.h
index 6714f2989bb4f3dead0dfc46e41c3abd4f820878..dd982b6eb58b64d5c5cebd17e769228ba88d2a02 100644
--- a/Source/core/fetch/Resource.h
+++ b/Source/core/fetch/Resource.h
@@ -197,8 +197,8 @@ public:
// Returns cached metadata of the given type associated with this resource.
CachedMetadata* cachedMetadata(unsigned dataTypeID) const;
- bool canDelete() const { return !hasClients() && !m_loader && !m_preloadCount && !m_handleCount && !m_protectorCount && !m_resourceToRevalidate && !m_proxyResource; }
- bool hasOneHandle() const { return m_handleCount == 1; }
+ bool canDelete();
Philippe 2014/03/26 16:04:07 Nit: did you drop the 'const' here intentionally?
Philippe 2014/03/26 17:08:33 Just sent this CL to Nate so that you can add the
clamy 2014/03/27 10:47:16 Thanks! I will make them const again.
+ bool hasOneHandleApartFromCache();
// List of acceptable MIME types separated by ",".
// A MIME type may contain a wildcard, e.g. "text/*".
@@ -342,6 +342,8 @@ private:
bool unlock();
+ bool hasRightHandleCountApartFromCache(unsigned targetCount);
+
void failBeforeStarting();
String m_fragmentIdentifierForRequest;

Powered by Google App Engine
This is Rietveld 408576698