Title: [87330] trunk/Source/WebCore
Revision
87330
Author
msab...@apple.com
Date
2011-05-25 16:05:29 -0700 (Wed, 25 May 2011)

Log Message

2011-05-25  Michael Saboff  <msab...@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):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (87329 => 87330)


--- trunk/Source/WebCore/ChangeLog	2011-05-25 23:00:45 UTC (rev 87329)
+++ trunk/Source/WebCore/ChangeLog	2011-05-25 23:05:29 UTC (rev 87330)
@@ -1,3 +1,25 @@
+2011-05-25  Michael Saboff  <msab...@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  <sle...@apple.com>
 
         Reviewed by Brady Eidson.

Modified: trunk/Source/WebCore/loader/cache/MemoryCache.cpp (87329 => 87330)


--- trunk/Source/WebCore/loader/cache/MemoryCache.cpp	2011-05-25 23:00:45 UTC (rev 87329)
+++ trunk/Source/WebCore/loader/cache/MemoryCache.cpp	2011-05-25 23:05:29 UTC (rev 87330)
@@ -176,7 +176,7 @@
     pruneLiveResourcesToSize(targetSize);
 }
 
-void MemoryCache::PruneLiveResourcesToPercentage(float prunePercentage)
+void MemoryCache::pruneLiveResourcesToPercentage(float prunePercentage)
 {
     if (!m_pruneEnabled)
         return;
@@ -239,7 +239,7 @@
     pruneDeadResourcesToSize(targetSize);
 }
 
-void MemoryCache::PruneDeadResourcesToPercentage(float prunePercentage)
+void MemoryCache::pruneDeadResourcesToPercentage(float prunePercentage)
 {
     if (!m_pruneEnabled)
         return;

Modified: trunk/Source/WebCore/loader/cache/MemoryCache.h (87329 => 87330)


--- trunk/Source/WebCore/loader/cache/MemoryCache.h	2011-05-25 23:00:45 UTC (rev 87329)
+++ trunk/Source/WebCore/loader/cache/MemoryCache.h	2011-05-25 23:05:29 UTC (rev 87330)
@@ -141,8 +141,8 @@
 
     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 @@
     // 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);
 

Modified: trunk/Source/WebCore/platform/mac/MemoryPressureHandlerMac.mm (87329 => 87330)


--- trunk/Source/WebCore/platform/mac/MemoryPressureHandlerMac.mm	2011-05-25 23:00:45 UTC (rev 87329)
+++ trunk/Source/WebCore/platform/mac/MemoryPressureHandlerMac.mm	2011-05-25 23:05:29 UTC (rev 87330)
@@ -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::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);
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to