Changeset 87330 in webkit


Ignore:
Timestamp:
May 25, 2011 4:05:29 PM (13 years ago)
Author:
msaboff@apple.com
Message:

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):
Location:
trunk/Source/WebCore
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r87329 r87330  
     12011-05-25  Michael Saboff  <msaboff@apple.com>
     2
     3        Reviewed by Sam Weinig.
     4
     5        Cleanup of commented items from https://bugs.webkit.org/show_bug.cgi?id=61222
     6        https://bugs.webkit.org/show_bug.cgi?id=61478
     7
     8        Cleanup of further comments after patch was landed.  Changes include
     9        using /2 instead of >>1, adding a blank line after class include,
     10        making method names start with lower case and adding clarifying
     11        comments.
     12
     13        No new tests as the changes are stylistic and not functional.
     14
     15        * loader/cache/MemoryCache.cpp:
     16        (WebCore::MemoryCache::pruneLiveResourcesToPercentage):
     17        (WebCore::MemoryCache::pruneDeadResourcesToPercentage):
     18        * loader/cache/MemoryCache.h:
     19        (WebCore::MemoryCache::pruneToPercentage):
     20        * platform/mac/MemoryPressureHandlerMac.mm:
     21        (WebCore::MemoryPressureHandler::respondToMemoryPressure):
     22
    1232011-05-25  Stephanie Lewis  <slewis@apple.com>
    224
  • trunk/Source/WebCore/loader/cache/MemoryCache.cpp

    r87239 r87330  
    177177}
    178178
    179 void MemoryCache::PruneLiveResourcesToPercentage(float prunePercentage)
     179void MemoryCache::pruneLiveResourcesToPercentage(float prunePercentage)
    180180{
    181181    if (!m_pruneEnabled)
     
    240240}
    241241
    242 void MemoryCache::PruneDeadResourcesToPercentage(float prunePercentage)
     242void MemoryCache::pruneDeadResourcesToPercentage(float prunePercentage)
    243243{
    244244    if (!m_pruneEnabled)
  • trunk/Source/WebCore/loader/cache/MemoryCache.h

    r87228 r87330  
    142142    void pruneToPercentage(float targetPercentLive)
    143143    {
    144         PruneDeadResourcesToPercentage(targetPercentLive); // Prune dead first, in case it was "borrowing" capacity from live.
    145         PruneLiveResourcesToPercentage(targetPercentLive);
     144        pruneDeadResourcesToPercentage(targetPercentLive); // Prune dead first, in case it was "borrowing" capacity from live.
     145        pruneLiveResourcesToPercentage(targetPercentLive);
    146146    }
    147147
     
    194194    void pruneDeadResources(); // Automatically decide how much to prune.
    195195    void pruneLiveResources();
    196     void PruneDeadResourcesToPercentage(float prunePercentage);
    197     void PruneLiveResourcesToPercentage(float prunePercentage);
     196    void pruneDeadResourcesToPercentage(float prunePercentage); // Prune to % current size
     197    void pruneLiveResourcesToPercentage(float prunePercentage);
    198198    void pruneDeadResourcesToSize(unsigned targetSize);
    199199    void pruneLiveResourcesToSize(unsigned targetSize);
  • trunk/Source/WebCore/platform/mac/MemoryPressureHandlerMac.mm

    r87228 r87330  
    2626#import "config.h"
    2727#import "MemoryPressureHandler.h"
     28
    2829#import <WebCore/GCController.h>
    2930#import <WebCore/MemoryCache.h>
     
    8788{
    8889    int savedPageCacheCapacity = pageCache()->capacity();
    89     pageCache()->setCapacity(pageCache()->pageCount()>>1);
     90    pageCache()->setCapacity(pageCache()->pageCount()/2);
    9091    pageCache()->setCapacity(savedPageCacheCapacity);
    9192    pageCache()->releaseAutoreleasedPagesNow();
     
    9394    NSURLCache *nsurlCache = [NSURLCache sharedURLCache];
    9495    NSUInteger savedNsurlCacheMemoryCapacity = [nsurlCache memoryCapacity];
    95     [nsurlCache setMemoryCapacity:[nsurlCache currentMemoryUsage]>>1];
     96    [nsurlCache setMemoryCapacity:[nsurlCache currentMemoryUsage]/2];
    9697    [nsurlCache setMemoryCapacity:savedNsurlCacheMemoryCapacity];
    9798 
Note: See TracChangeset for help on using the changeset viewer.