[Webkit-unassigned] [Bug 75991] make the code in MemoryPressureHandler::respondToMemoryPressure shareable.

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Jan 12 10:33:19 PST 2012


https://bugs.webkit.org/show_bug.cgi?id=75991





--- Comment #4 from Yongjun Zhang <yongjun_zhang at apple.com>  2012-01-12 10:33:19 PST ---
(In reply to comment #3)
> (From update of attachment 121913 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=121913&action=review
> 
> > Source/WebCore/platform/mac/MemoryPressureHandlerMac.mm:118
> > +    releaseMemory(false);
> 
> This boolean should ideally be an enum:
> releaseMemory(Normal)
> releaseMemory(Critical)
> 

Agree.  Currently we only have two levels, we can consider changing this to enum when new levels are introduced.

> > Source/WebCore/platform/mac/MemoryPressureHandlerMac.mm:123
> > +void MemoryPressureHandler::releaseMemory(bool critical)
> > +{
> 
> What do you think about moving this to a separate common file? As it is, 90% of this file is blacklisted for iOS. Separate files are easier to maintain that #ifdef imho (although the file would be very simple in this case).
>

I thought about that, but didn't like the idea of having a separate file with just this one function.

> If you choose the #ifdef, do not forget to add || PLATFORM(IOS) to MemoryPressureHandler.cpp.

Ok, looks like we already had that for iOS.
> 
> > Source/WebCore/platform/mac/MemoryPressureHandlerMac.mm:125
> > -    pageCache()->setCapacity(pageCache()->pageCount()/2);
> > +    pageCache()->setCapacity(critical ? 0 : pageCache()->pageCount()/2);
> 
> Spaces around operator.
> 
> > Source/WebCore/platform/mac/MemoryPressureHandlerMac.mm:131
> > +    [nsurlCache setMemoryCapacity:critical ? 0 : [nsurlCache currentMemoryUsage]/2];
> 
> Spaces around operator.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list