Reviewed by Sam Weinig.
Cleanup of commented items from https://bugs.webkit.org/show_bug.cgi?id=61222
https://bugs.webkit.org/show_bug.cgi?id=61478
Cleanup of further comments after patch was landed. Changes include
using /2 instead of >>1, adding a blank line after class include,
making method names start with lower case and adding clarifying
comments.
No new tests as the changes are stylistic and not functional.
* loader/cache/MemoryCache.cpp:
(WebCore::MemoryCache::pruneLiveResourcesToPercentage):
(WebCore::MemoryCache::pruneDeadResourcesToPercentage):
* loader/cache/MemoryCache.h:
(WebCore::MemoryCache::pruneToPercentage):
* platform/mac/MemoryPressureHandlerMac.mm:
(WebCore::MemoryPressureHandler::respondToMemoryPressure):
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@87330
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2011-05-25 Michael Saboff <msaboff@apple.com>
+
+ Reviewed by Sam Weinig.
+
+ Cleanup of commented items from https://bugs.webkit.org/show_bug.cgi?id=61222
+ https://bugs.webkit.org/show_bug.cgi?id=61478
+
+ Cleanup of further comments after patch was landed. Changes include
+ using /2 instead of >>1, adding a blank line after class include,
+ making method names start with lower case and adding clarifying
+ comments.
+
+ No new tests as the changes are stylistic and not functional.
+
+ * loader/cache/MemoryCache.cpp:
+ (WebCore::MemoryCache::pruneLiveResourcesToPercentage):
+ (WebCore::MemoryCache::pruneDeadResourcesToPercentage):
+ * loader/cache/MemoryCache.h:
+ (WebCore::MemoryCache::pruneToPercentage):
+ * platform/mac/MemoryPressureHandlerMac.mm:
+ (WebCore::MemoryPressureHandler::respondToMemoryPressure):
+
2011-05-25 Stephanie Lewis <slewis@apple.com>
Reviewed by Brady Eidson.
pruneLiveResourcesToSize(targetSize);
}
-void MemoryCache::PruneLiveResourcesToPercentage(float prunePercentage)
+void MemoryCache::pruneLiveResourcesToPercentage(float prunePercentage)
{
if (!m_pruneEnabled)
return;
pruneDeadResourcesToSize(targetSize);
}
-void MemoryCache::PruneDeadResourcesToPercentage(float prunePercentage)
+void MemoryCache::pruneDeadResourcesToPercentage(float prunePercentage)
{
if (!m_pruneEnabled)
return;
void pruneToPercentage(float targetPercentLive)
{
- PruneDeadResourcesToPercentage(targetPercentLive); // Prune dead first, in case it was "borrowing" capacity from live.
- PruneLiveResourcesToPercentage(targetPercentLive);
+ pruneDeadResourcesToPercentage(targetPercentLive); // Prune dead first, in case it was "borrowing" capacity from live.
+ pruneLiveResourcesToPercentage(targetPercentLive);
}
void setDeadDecodedDataDeletionInterval(double interval) { m_deadDecodedDataDeletionInterval = interval; }
// pruneLive*() - Flush decoded data from resources still referenced by Web pages.
void pruneDeadResources(); // Automatically decide how much to prune.
void pruneLiveResources();
- void PruneDeadResourcesToPercentage(float prunePercentage);
- void PruneLiveResourcesToPercentage(float prunePercentage);
+ void pruneDeadResourcesToPercentage(float prunePercentage); // Prune to % current size
+ void pruneLiveResourcesToPercentage(float prunePercentage);
void pruneDeadResourcesToSize(unsigned targetSize);
void pruneLiveResourcesToSize(unsigned targetSize);
#import "config.h"
#import "MemoryPressureHandler.h"
+
#import <WebCore/GCController.h>
#import <WebCore/MemoryCache.h>
#import <WebCore/PageCache.h>
void MemoryPressureHandler::respondToMemoryPressure()
{
int savedPageCacheCapacity = pageCache()->capacity();
- pageCache()->setCapacity(pageCache()->pageCount()>>1);
+ pageCache()->setCapacity(pageCache()->pageCount()/2);
pageCache()->setCapacity(savedPageCacheCapacity);
pageCache()->releaseAutoreleasedPagesNow();
NSURLCache *nsurlCache = [NSURLCache sharedURLCache];
NSUInteger savedNsurlCacheMemoryCapacity = [nsurlCache memoryCapacity];
- [nsurlCache setMemoryCapacity:[nsurlCache currentMemoryUsage]>>1];
+ [nsurlCache setMemoryCapacity:[nsurlCache currentMemoryUsage]/2];
[nsurlCache setMemoryCapacity:savedNsurlCacheMemoryCapacity];
memoryCache()->pruneToPercentage(0.5f);