<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[179293] trunk/Source</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/179293">179293</a></dd>
<dt>Author</dt> <dd>cdumez@apple.com</dd>
<dt>Date</dt> <dd>2015-01-28 14:20:36 -0800 (Wed, 28 Jan 2015)</dd>
</dl>
<h3>Log Message</h3>
<pre>Remove dead code from MemoryCache
https://bugs.webkit.org/show_bug.cgi?id=140964
Reviewed by Andreas Kling.
Remove dead code from MemoryCache, make more things private and
clean up a little bit.
* WebCore.exp.in:
* inspector/InspectorResourceAgent.cpp:
* loader/cache/MemoryCache.cpp:
(WebCore::MemoryCache::MemoryCache):
(WebCore::MemoryCache::revalidationSucceeded):
(WebCore::MemoryCache::removeImageFromCache):
(WebCore::MemoryCache::pruneLiveResources):
(WebCore::MemoryCache::pruneDeadResources):
(WebCore::MemoryCache::pruneDeadResourcesToSize):
(WebCore::MemoryCache::remove):
(WebCore::MemoryCache::removeRequestFromSessionCaches):
(WebCore::MemoryCache::setDisabled):
(WebCore::MemoryCache::resourceForURL): Deleted.
(WebCore::MemoryCache::pruneLiveResourcesToPercentage): Deleted.
(WebCore::MemoryCache::pruneDeadResourcesToPercentage): Deleted.
(WebCore::MemoryCache::evict): Deleted.
(WebCore::MemoryCache::removeUrlFromCache): Deleted.
(WebCore::MemoryCache::removeRequestFromCache): Deleted.
(WebCore::MemoryCache::pruneToPercentage): Deleted.
* loader/cache/MemoryCache.h:
(WebCore::MemoryCache::LRUList::LRUList): Deleted.
(WebCore::MemoryCache::remove): Deleted.
(WebCore::MemoryCache::setPruneEnabled): Deleted.
(WebCore::MemoryCache::minDeadCapacity): Deleted.
(WebCore::MemoryCache::maxDeadCapacity): Deleted.
(WebCore::MemoryCache::capacity): Deleted.
(WebCore::MemoryCache::liveSize): Deleted.
(WebCore::MemoryCache::deadSize): Deleted.
* platform/MemoryPressureHandler.cpp:
(WebCore::MemoryPressureHandler::releaseCriticalMemory):</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreWebCoreexpin">trunk/Source/WebCore/WebCore.exp.in</a></li>
<li><a href="#trunkSourceWebCoreloadercacheMemoryCachecpp">trunk/Source/WebCore/loader/cache/MemoryCache.cpp</a></li>
<li><a href="#trunkSourceWebCoreloadercacheMemoryCacheh">trunk/Source/WebCore/loader/cache/MemoryCache.h</a></li>
<li><a href="#trunkSourceWebCoreplatformMemoryPressureHandlercpp">trunk/Source/WebCore/platform/MemoryPressureHandler.cpp</a></li>
<li><a href="#trunkSourceWebKitWebKitvcxprojWebKitExportGeneratorWebKitExportsdefin">trunk/Source/WebKit/WebKit.vcxproj/WebKitExportGenerator/WebKitExports.def.in</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (179292 => 179293)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2015-01-28 22:04:13 UTC (rev 179292)
+++ trunk/Source/WebCore/ChangeLog        2015-01-28 22:20:36 UTC (rev 179293)
</span><span class="lines">@@ -1,3 +1,44 @@
</span><ins>+2015-01-28 Chris Dumez <cdumez@apple.com>
+
+ Remove dead code from MemoryCache
+ https://bugs.webkit.org/show_bug.cgi?id=140964
+
+ Reviewed by Andreas Kling.
+
+ Remove dead code from MemoryCache, make more things private and
+ clean up a little bit.
+
+ * WebCore.exp.in:
+ * inspector/InspectorResourceAgent.cpp:
+ * loader/cache/MemoryCache.cpp:
+ (WebCore::MemoryCache::MemoryCache):
+ (WebCore::MemoryCache::revalidationSucceeded):
+ (WebCore::MemoryCache::removeImageFromCache):
+ (WebCore::MemoryCache::pruneLiveResources):
+ (WebCore::MemoryCache::pruneDeadResources):
+ (WebCore::MemoryCache::pruneDeadResourcesToSize):
+ (WebCore::MemoryCache::remove):
+ (WebCore::MemoryCache::removeRequestFromSessionCaches):
+ (WebCore::MemoryCache::setDisabled):
+ (WebCore::MemoryCache::resourceForURL): Deleted.
+ (WebCore::MemoryCache::pruneLiveResourcesToPercentage): Deleted.
+ (WebCore::MemoryCache::pruneDeadResourcesToPercentage): Deleted.
+ (WebCore::MemoryCache::evict): Deleted.
+ (WebCore::MemoryCache::removeUrlFromCache): Deleted.
+ (WebCore::MemoryCache::removeRequestFromCache): Deleted.
+ (WebCore::MemoryCache::pruneToPercentage): Deleted.
+ * loader/cache/MemoryCache.h:
+ (WebCore::MemoryCache::LRUList::LRUList): Deleted.
+ (WebCore::MemoryCache::remove): Deleted.
+ (WebCore::MemoryCache::setPruneEnabled): Deleted.
+ (WebCore::MemoryCache::minDeadCapacity): Deleted.
+ (WebCore::MemoryCache::maxDeadCapacity): Deleted.
+ (WebCore::MemoryCache::capacity): Deleted.
+ (WebCore::MemoryCache::liveSize): Deleted.
+ (WebCore::MemoryCache::deadSize): Deleted.
+ * platform/MemoryPressureHandler.cpp:
+ (WebCore::MemoryPressureHandler::releaseCriticalMemory):
+
</ins><span class="cx"> 2015-01-28 Brian J. Burg <burg@cs.washington.edu>
</span><span class="cx">
</span><span class="cx"> Web Inspector: remove CSS.setPropertyText, CSS.toggleProperty and related dead code
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCoreexpin"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.exp.in (179292 => 179293)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.exp.in        2015-01-28 22:04:13 UTC (rev 179292)
+++ trunk/Source/WebCore/WebCore.exp.in        2015-01-28 22:20:36 UTC (rev 179293)
</span><span class="lines">@@ -191,7 +191,6 @@
</span><span class="cx"> __ZN7WebCore11MemoryCache13getStatisticsEv
</span><span class="cx"> __ZN7WebCore11MemoryCache13setCapacitiesEjjj
</span><span class="cx"> __ZN7WebCore11MemoryCache14evictResourcesEv
</span><del>-__ZN7WebCore11MemoryCache14resourceForURLERKNS_3URLE
</del><span class="cx"> __ZN7WebCore11MemoryCache14resourceForURLERKNS_3URLENS_9SessionIDE
</span><span class="cx"> __ZN7WebCore11MemoryCache15addImageToCacheEP7CGImageRKNS_3URLERKN3WTF6StringE
</span><span class="cx"> __ZN7WebCore11MemoryCache18resourceForRequestERKNS_15ResourceRequestENS_9SessionIDE
</span></span></pre></div>
<a id="trunkSourceWebCoreloadercacheMemoryCachecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/cache/MemoryCache.cpp (179292 => 179293)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/cache/MemoryCache.cpp        2015-01-28 22:04:13 UTC (rev 179292)
+++ trunk/Source/WebCore/loader/cache/MemoryCache.cpp        2015-01-28 22:20:36 UTC (rev 179293)
</span><span class="lines">@@ -35,8 +35,6 @@
</span><span class="cx"> #include "Image.h"
</span><span class="cx"> #include "Logging.h"
</span><span class="cx"> #include "PublicSuffix.h"
</span><del>-#include "SecurityOrigin.h"
-#include "SecurityOriginHash.h"
</del><span class="cx"> #include "SharedBuffer.h"
</span><span class="cx"> #include "WorkerGlobalScope.h"
</span><span class="cx"> #include "WorkerLoaderProxy.h"
</span><span class="lines">@@ -66,7 +64,6 @@
</span><span class="cx">
</span><span class="cx"> MemoryCache::MemoryCache()
</span><span class="cx"> : m_disabled(false)
</span><del>- , m_pruneEnabled(true)
</del><span class="cx"> , m_inPruneResources(false)
</span><span class="cx"> , m_capacity(cDefaultCacheCapacity)
</span><span class="cx"> , m_minDeadCapacity(0)
</span><span class="lines">@@ -136,12 +133,12 @@
</span><span class="cx"> ASSERT(resource->isLoaded());
</span><span class="cx"> ASSERT(revalidatingResource->inCache());
</span><span class="cx">
</span><del>- // Calling evict() can potentially delete revalidatingResource, which we use
</del><ins>+ // Calling remove() can potentially delete revalidatingResource, which we use
</ins><span class="cx"> // below. This mustn't be the case since revalidation means it is loaded
</span><span class="cx"> // and so canDelete() is false.
</span><span class="cx"> ASSERT(!revalidatingResource->canDelete());
</span><span class="cx">
</span><del>- evict(revalidatingResource);
</del><ins>+ remove(revalidatingResource);
</ins><span class="cx">
</span><span class="cx"> CachedResourceMap& resources = getSessionMap(resource->sessionID());
</span><span class="cx"> #if ENABLE(CACHE_PARTITIONING)
</span><span class="lines">@@ -179,11 +176,6 @@
</span><span class="cx"> revalidatingResource->clearResourceToRevalidate();
</span><span class="cx"> }
</span><span class="cx">
</span><del>-CachedResource* MemoryCache::resourceForURL(const URL& resourceURL)
-{
- return resourceForURL(resourceURL, SessionID::defaultSessionID());
-}
-
</del><span class="cx"> CachedResource* MemoryCache::resourceForURL(const URL& resourceURL, SessionID sessionID)
</span><span class="cx"> {
</span><span class="cx"> return resourceForRequest(ResourceRequest(resourceURL), sessionID);
</span><span class="lines">@@ -274,7 +266,7 @@
</span><span class="cx">
</span><span class="cx"> // A resource exists and is not a manually cached image, so just remove it.
</span><span class="cx"> if (!is<CachedImage>(*resource) || !downcast<CachedImage>(*resource).isManuallyCached()) {
</span><del>- evict(resource);
</del><ins>+ remove(resource);
</ins><span class="cx"> return;
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -289,9 +281,6 @@
</span><span class="cx">
</span><span class="cx"> void MemoryCache::pruneLiveResources(bool shouldDestroyDecodedDataForAllLiveResources)
</span><span class="cx"> {
</span><del>- if (!m_pruneEnabled)
- return;
-
</del><span class="cx"> unsigned capacity = shouldDestroyDecodedDataForAllLiveResources ? 0 : liveCapacity();
</span><span class="cx"> if (capacity && m_liveSize <= capacity)
</span><span class="cx"> return;
</span><span class="lines">@@ -301,20 +290,6 @@
</span><span class="cx"> pruneLiveResourcesToSize(targetSize, shouldDestroyDecodedDataForAllLiveResources);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void MemoryCache::pruneLiveResourcesToPercentage(float prunePercentage)
-{
- if (!m_pruneEnabled)
- return;
-
- if (prunePercentage < 0.0f || prunePercentage > 0.95f)
- return;
-
- unsigned currentSize = m_liveSize + m_deadSize;
- unsigned targetSize = static_cast<unsigned>(currentSize * prunePercentage);
-
- pruneLiveResourcesToSize(targetSize);
-}
-
</del><span class="cx"> void MemoryCache::pruneLiveResourcesToSize(unsigned targetSize, bool shouldDestroyDecodedDataForAllLiveResources)
</span><span class="cx"> {
</span><span class="cx"> if (m_inPruneResources)
</span><span class="lines">@@ -362,9 +337,6 @@
</span><span class="cx">
</span><span class="cx"> void MemoryCache::pruneDeadResources()
</span><span class="cx"> {
</span><del>- if (!m_pruneEnabled)
- return;
-
</del><span class="cx"> unsigned capacity = deadCapacity();
</span><span class="cx"> if (capacity && m_deadSize <= capacity)
</span><span class="cx"> return;
</span><span class="lines">@@ -373,20 +345,6 @@
</span><span class="cx"> pruneDeadResourcesToSize(targetSize);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void MemoryCache::pruneDeadResourcesToPercentage(float prunePercentage)
-{
- if (!m_pruneEnabled)
- return;
-
- if (prunePercentage < 0.0f || prunePercentage > 0.95f)
- return;
-
- unsigned currentSize = m_liveSize + m_deadSize;
- unsigned targetSize = static_cast<unsigned>(currentSize * prunePercentage);
-
- pruneDeadResourcesToSize(targetSize);
-}
-
</del><span class="cx"> void MemoryCache::pruneDeadResourcesToSize(unsigned targetSize)
</span><span class="cx"> {
</span><span class="cx"> if (m_inPruneResources)
</span><span class="lines">@@ -430,7 +388,7 @@
</span><span class="cx"> CachedResourceHandle<CachedResource> previous = current->m_prevInAllResourcesList;
</span><span class="cx"> ASSERT(!previous || previous->inCache());
</span><span class="cx"> if (!current->hasClients() && !current->isPreloaded() && !current->isCacheValidator()) {
</span><del>- evict(current);
</del><ins>+ remove(current);
</ins><span class="cx"> if (targetSize && m_deadSize <= targetSize)
</span><span class="cx"> return;
</span><span class="cx"> }
</span><span class="lines">@@ -458,7 +416,7 @@
</span><span class="cx"> prune();
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void MemoryCache::evict(CachedResource* resource)
</del><ins>+void MemoryCache::remove(CachedResource* resource)
</ins><span class="cx"> {
</span><span class="cx"> ASSERT(WTF::isMainThread());
</span><span class="cx"> LOG(ResourceLoading, "Evicting resource %p for '%s' from cache", resource, resource->url().string().latin1().data());
</span><span class="lines">@@ -750,27 +708,6 @@
</span><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void MemoryCache::removeUrlFromCache(ScriptExecutionContext* context, const String& urlString, SessionID sessionID)
-{
- removeRequestFromCache(context, ResourceRequest(urlString), sessionID);
-}
-
-void MemoryCache::removeRequestFromCache(ScriptExecutionContext* context, const ResourceRequest& request, SessionID sessionID)
-{
- ASSERT(context);
- if (is<WorkerGlobalScope>(*context)) {
- CrossThreadResourceRequestData* requestData = request.copyData().leakPtr();
- downcast<WorkerGlobalScope>(*context).thread().workerLoaderProxy().postTaskToLoader([requestData, sessionID] (ScriptExecutionContext& context) {
- OwnPtr<ResourceRequest> request(ResourceRequest::adopt(adoptPtr(requestData)));
- removeRequestFromCache(&context, *request, sessionID);
- });
- return;
- }
-
- if (CachedResource* resource = memoryCache().resourceForRequest(request, sessionID))
- memoryCache().remove(resource);
-}
-
</del><span class="cx"> void MemoryCache::removeRequestFromSessionCaches(ScriptExecutionContext* context, const ResourceRequest& request)
</span><span class="cx"> {
</span><span class="cx"> ASSERT(context);
</span><span class="lines">@@ -785,7 +722,7 @@
</span><span class="cx">
</span><span class="cx"> for (auto& resources : memoryCache().m_sessionResources) {
</span><span class="cx"> if (CachedResource* resource = memoryCache().resourceForRequestImpl(request, *resources.value))
</span><del>- memoryCache().remove(resource);
</del><ins>+ memoryCache().remove(resource);
</ins><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -857,9 +794,9 @@
</span><span class="cx"> break;
</span><span class="cx"> #if ENABLE(CACHE_PARTITIONING)
</span><span class="cx"> CachedResourceItem::iterator innerIterator = outerIterator->value->begin();
</span><del>- evict(innerIterator->value);
</del><ins>+ remove(innerIterator->value);
</ins><span class="cx"> #else
</span><del>- evict(outerIterator->value);
</del><ins>+ remove(outerIterator->value);
</ins><span class="cx"> #endif
</span><span class="cx"> }
</span><span class="cx"> }
</span><span class="lines">@@ -882,13 +819,6 @@
</span><span class="cx"> pruneLiveResources();
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void MemoryCache::pruneToPercentage(float targetPercentLive)
-{
- pruneDeadResourcesToPercentage(targetPercentLive); // Prune dead first, in case it was "borrowing" capacity from live.
- pruneLiveResourcesToPercentage(targetPercentLive);
-}
-
-
</del><span class="cx"> #ifndef NDEBUG
</span><span class="cx"> void MemoryCache::dumpStats()
</span><span class="cx"> {
</span></span></pre></div>
<a id="trunkSourceWebCoreloadercacheMemoryCacheh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/cache/MemoryCache.h (179292 => 179293)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/cache/MemoryCache.h        2015-01-28 22:04:13 UTC (rev 179292)
+++ trunk/Source/WebCore/loader/cache/MemoryCache.h        2015-01-28 22:20:36 UTC (rev 179293)
</span><span class="lines">@@ -38,16 +38,12 @@
</span><span class="cx">
</span><span class="cx"> namespace WebCore {
</span><span class="cx">
</span><del>-class CachedCSSStyleSheet;
</del><span class="cx"> class CachedResource;
</span><del>-class CachedResourceLoader;
</del><span class="cx"> class URL;
</span><span class="cx"> class ResourceRequest;
</span><span class="cx"> class ResourceResponse;
</span><span class="cx"> class ScriptExecutionContext;
</span><span class="cx"> class SecurityOrigin;
</span><del>-struct CrossThreadResourceRequestData;
-struct SecurityOriginHash;
</del><span class="cx">
</span><span class="cx"> // This cache holds subresources used by Web pages: images, scripts, stylesheets, etc.
</span><span class="cx">
</span><span class="lines">@@ -67,20 +63,6 @@
</span><span class="cx"> public:
</span><span class="cx"> friend NeverDestroyed<MemoryCache>;
</span><span class="cx">
</span><del>-#if ENABLE(CACHE_PARTITIONING)
- typedef HashMap<String, CachedResource*> CachedResourceItem;
- typedef HashMap<String, OwnPtr<CachedResourceItem>> CachedResourceMap;
-#else
- typedef HashMap<String, CachedResource*> CachedResourceMap;
-#endif
- typedef HashMap<SessionID, std::unique_ptr<CachedResourceMap>> SessionCachedResourceMap;
-
- struct LRUList {
- CachedResource* m_head;
- CachedResource* m_tail;
- LRUList() : m_head(0), m_tail(0) { }
- };
-
</del><span class="cx"> struct TypeStatistic {
</span><span class="cx"> int count;
</span><span class="cx"> int size;
</span><span class="lines">@@ -106,12 +88,11 @@
</span><span class="cx"> TypeStatistic fonts;
</span><span class="cx"> };
</span><span class="cx">
</span><del>- WEBCORE_EXPORT CachedResource* resourceForURL(const URL&);
- WEBCORE_EXPORT CachedResource* resourceForURL(const URL&, SessionID);
</del><ins>+ WEBCORE_EXPORT CachedResource* resourceForURL(const URL&, SessionID = SessionID::defaultSessionID());
</ins><span class="cx"> WEBCORE_EXPORT CachedResource* resourceForRequest(const ResourceRequest&, SessionID);
</span><span class="cx">
</span><span class="cx"> bool add(CachedResource*);
</span><del>- void remove(CachedResource* resource) { evict(resource); }
</del><ins>+ void remove(CachedResource*);
</ins><span class="cx">
</span><span class="cx"> static URL removeFragmentIdentifierIfNeeded(const URL& originalURL);
</span><span class="cx">
</span><span class="lines">@@ -132,9 +113,7 @@
</span><span class="cx">
</span><span class="cx"> WEBCORE_EXPORT void evictResources();
</span><span class="cx">
</span><del>- void setPruneEnabled(bool enabled) { m_pruneEnabled = enabled; }
</del><span class="cx"> void prune();
</span><del>- void pruneToPercentage(float targetPercentLive);
</del><span class="cx">
</span><span class="cx"> void setDeadDecodedDataDeletionInterval(std::chrono::milliseconds interval) { m_deadDecodedDataDeletionInterval = interval; }
</span><span class="cx"> std::chrono::milliseconds deadDecodedDataDeletionInterval() const { return m_deadDecodedDataDeletionInterval; }
</span><span class="lines">@@ -153,8 +132,6 @@
</span><span class="cx"> void addToLiveResourcesSize(CachedResource*);
</span><span class="cx"> void removeFromLiveResourcesSize(CachedResource*);
</span><span class="cx">
</span><del>- static void removeUrlFromCache(ScriptExecutionContext*, const String& urlString, SessionID);
- static void removeRequestFromCache(ScriptExecutionContext*, const ResourceRequest&, SessionID);
</del><span class="cx"> static void removeRequestFromSessionCaches(ScriptExecutionContext*, const ResourceRequest&);
</span><span class="cx">
</span><span class="cx"> // Function to collect cache statistics for the caches window in the Safari Debug menu.
</span><span class="lines">@@ -166,12 +143,6 @@
</span><span class="cx"> WEBCORE_EXPORT void removeResourcesWithOrigin(SecurityOrigin*);
</span><span class="cx"> WEBCORE_EXPORT void getOriginsWithCache(SecurityOriginSet& origins);
</span><span class="cx">
</span><del>- unsigned minDeadCapacity() const { return m_minDeadCapacity; }
- unsigned maxDeadCapacity() const { return m_maxDeadCapacity; }
- unsigned capacity() const { return m_capacity; }
- unsigned liveSize() const { return m_liveSize; }
- unsigned deadSize() const { return m_deadSize; }
-
</del><span class="cx"> #if USE(CG)
</span><span class="cx"> // FIXME: Remove the USE(CG) once we either make NativeImagePtr a smart pointer on all platforms or
</span><span class="cx"> // remove the usage of CFRetain() in MemoryCache::addImageToCache() so as to make the code platform-independent.
</span><span class="lines">@@ -185,8 +156,18 @@
</span><span class="cx"> WEBCORE_EXPORT void pruneLiveResources(bool shouldDestroyDecodedDataForAllLiveResources = false);
</span><span class="cx">
</span><span class="cx"> private:
</span><del>- void pruneDeadResourcesToPercentage(float prunePercentage); // Prune to % current size
- void pruneLiveResourcesToPercentage(float prunePercentage);
</del><ins>+#if ENABLE(CACHE_PARTITIONING)
+ typedef HashMap<String, CachedResource*> CachedResourceItem;
+ typedef HashMap<String, OwnPtr<CachedResourceItem>> CachedResourceMap;
+#else
+ typedef HashMap<String, CachedResource*> CachedResourceMap;
+#endif
+
+ struct LRUList {
+ CachedResource* m_head {nullptr};
+ CachedResource* m_tail {nullptr};
+ };
+
</ins><span class="cx"> void pruneDeadResourcesToSize(unsigned targetSize);
</span><span class="cx"> void pruneLiveResourcesToSize(unsigned targetSize, bool shouldDestroyDecodedDataForAllLiveResources = false);
</span><span class="cx">
</span><span class="lines">@@ -202,14 +183,10 @@
</span><span class="cx"> unsigned liveCapacity() const;
</span><span class="cx"> unsigned deadCapacity() const;
</span><span class="cx">
</span><del>- void evict(CachedResource*);
-
- WEBCORE_EXPORT CachedResource* resourceForRequestImpl(const ResourceRequest&, CachedResourceMap&);
-
</del><ins>+ CachedResource* resourceForRequestImpl(const ResourceRequest&, CachedResourceMap&);
</ins><span class="cx"> CachedResourceMap& getSessionMap(SessionID);
</span><span class="cx">
</span><span class="cx"> bool m_disabled; // Whether or not the cache is enabled.
</span><del>- bool m_pruneEnabled;
</del><span class="cx"> bool m_inPruneResources;
</span><span class="cx">
</span><span class="cx"> unsigned m_capacity;
</span><span class="lines">@@ -230,6 +207,7 @@
</span><span class="cx">
</span><span class="cx"> // A URL-based map of all resources that are in the cache (including the freshest version of objects that are currently being
</span><span class="cx"> // referenced by a Web page).
</span><ins>+ typedef HashMap<SessionID, std::unique_ptr<CachedResourceMap>> SessionCachedResourceMap;
</ins><span class="cx"> SessionCachedResourceMap m_sessionResources;
</span><span class="cx"> };
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformMemoryPressureHandlercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/MemoryPressureHandler.cpp (179292 => 179293)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/MemoryPressureHandler.cpp        2015-01-28 22:04:13 UTC (rev 179292)
+++ trunk/Source/WebCore/platform/MemoryPressureHandler.cpp        2015-01-28 22:20:36 UTC (rev 179293)
</span><span class="lines">@@ -107,7 +107,7 @@
</span><span class="cx">
</span><span class="cx"> {
</span><span class="cx"> ReliefLogger log("Prune MemoryCache");
</span><del>- memoryCache().pruneToPercentage(0);
</del><ins>+ memoryCache().evictResources();
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> {
</span></span></pre></div>
<a id="trunkSourceWebKitWebKitvcxprojWebKitExportGeneratorWebKitExportsdefin"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/WebKit.vcxproj/WebKitExportGenerator/WebKitExports.def.in (179292 => 179293)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/WebKit.vcxproj/WebKitExportGenerator/WebKitExports.def.in        2015-01-28 22:04:13 UTC (rev 179292)
+++ trunk/Source/WebKit/WebKit.vcxproj/WebKitExportGenerator/WebKitExports.def.in        2015-01-28 22:20:36 UTC (rev 179293)
</span><span class="lines">@@ -406,7 +406,6 @@
</span><span class="cx"> symbolWithPointer(?pauseTransitionAtTime@AnimationController@WebCore@@QAE_NPAVRenderElement@2@ABVString@WTF@@N@Z, ?pauseTransitionAtTime@AnimationController@WebCore@@QEAA_NPEAVRenderElement@2@AEBVString@WTF@@N@Z)
</span><span class="cx"> symbolWithPointer(?memoryCache@WebCore@@YAAAVMemoryCache@1@XZ, ?memoryCache@WebCore@@YAAEAVMemoryCache@1@XZ)
</span><span class="cx"> symbolWithPointer(?evictResources@MemoryCache@WebCore@@QAEXXZ, ?evictResources@MemoryCache@WebCore@@QEAAXXZ)
</span><del>- symbolWithPointer(?resourceForURL@MemoryCache@WebCore@@QAEPAVCachedResource@2@ABVURL@2@@Z, ?resourceForURL@MemoryCache@WebCore@@QEAAPEAVCachedResource@2@AEBVURL@2@@Z)
</del><span class="cx"> symbolWithPointer(?nonFastScrollableRects@Page@WebCore@@QAE?AV?$Ref@VClientRectList@WebCore@@@WTF@@PBVFrame@2@@Z, ?nonFastScrollableRects@Page@WebCore@@QEAA?AV?$Ref@VClientRectList@WebCore@@@WTF@@PEBVFrame@2@@Z)
</span><span class="cx"> symbolWithPointer(?numberOfActiveAnimations@AnimationController@WebCore@@QBEIPAVDocument@2@@Z, ?numberOfActiveAnimations@AnimationController@WebCore@@QEBAIPEAVDocument@2@@Z)
</span><span class="cx"> symbolWithPointer(?minDOMTimerInterval@Settings@WebCore@@QAENXZ, ?minDOMTimerInterval@Settings@WebCore@@QEAANXZ)
</span></span></pre>
</div>
</div>
</body>
</html>