2011-05-25 Michael Saboff <msaboff@apple.com>
authormsaboff@apple.com <msaboff@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 25 May 2011 23:05:29 +0000 (23:05 +0000)
committermsaboff@apple.com <msaboff@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 25 May 2011 23:05:29 +0000 (23:05 +0000)
        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

Source/WebCore/ChangeLog
Source/WebCore/loader/cache/MemoryCache.cpp
Source/WebCore/loader/cache/MemoryCache.h
Source/WebCore/platform/mac/MemoryPressureHandlerMac.mm

index 6461923..6392ac4 100644 (file)
@@ -1,3 +1,25 @@
+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.
index 103fac1..7568b45 100644 (file)
@@ -176,7 +176,7 @@ void MemoryCache::pruneLiveResources()
     pruneLiveResourcesToSize(targetSize);
 }
 
-void MemoryCache::PruneLiveResourcesToPercentage(float prunePercentage)
+void MemoryCache::pruneLiveResourcesToPercentage(float prunePercentage)
 {
     if (!m_pruneEnabled)
         return;
@@ -239,7 +239,7 @@ void MemoryCache::pruneDeadResources()
     pruneDeadResourcesToSize(targetSize);
 }
 
-void MemoryCache::PruneDeadResourcesToPercentage(float prunePercentage)
+void MemoryCache::pruneDeadResourcesToPercentage(float prunePercentage)
 {
     if (!m_pruneEnabled)
         return;
index 730902a..c5752d0 100644 (file)
@@ -141,8 +141,8 @@ public:
 
     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; }
@@ -193,8 +193,8 @@ private:
     // 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);
 
index fb46d4e..924697c 100644 (file)
@@ -25,6 +25,7 @@
 
 #import "config.h"
 #import "MemoryPressureHandler.h"
+
 #import <WebCore/GCController.h>
 #import <WebCore/MemoryCache.h>
 #import <WebCore/PageCache.h>
@@ -86,13 +87,13 @@ void MemoryPressureHandler::install()
 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);