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

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Jan 11 19:08:31 PST 2012


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


Benjamin Poulain <benjamin at webkit.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
 Attachment #121913|review?                     |review+, commit-queue-
               Flag|                            |




--- Comment #3 from Benjamin Poulain <benjamin at webkit.org>  2012-01-11 19:08:31 PST ---
(From update of attachment 121913)
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)

> 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).

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

> 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