Bug 62679 - Add notify handler to trigger MemoryPressureHandler in all builds
Summary: Add notify handler to trigger MemoryPressureHandler in all builds
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Michael Saboff
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-06-14 16:51 PDT by Michael Saboff
Modified: 2011-06-19 05:55 PDT (History)
0 users

See Also:


Attachments
Proposed patch (1.98 KB, patch)
2011-06-15 09:59 PDT, Michael Saboff
no flags Details | Formatted Diff | Diff
Updated patch using notify (2.47 KB, patch)
2011-06-18 12:09 PDT, Michael Saboff
darin: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Saboff 2011-06-14 16:51:17 PDT
Remove the #ifndef NDEBUG around the installation of the SIGUSR2 dispatch for triggering MemoryPressureHandler::respondToMemoryPressure().
Comment 1 Michael Saboff 2011-06-15 09:59:19 PDT
Created attachment 97314 [details]
Proposed patch
Comment 2 Geoffrey Garen 2011-06-15 14:17:48 PDT
Comment on attachment 97314 [details]
Proposed patch

r=me
Comment 3 Michael Saboff 2011-06-18 12:09:09 PDT
Created attachment 97703 [details]
Updated patch using notify
Comment 4 Darin Adler 2011-06-18 12:11:18 PDT
Comment on attachment 97703 [details]
Updated patch using notify

View in context: https://bugs.webkit.org/attachment.cgi?id=97703&action=review

> Source/WebCore/platform/mac/MemoryPressureHandlerMac.mm:55
> +static int notifyToken;

This can go inside the function where it’s used instead of at the file level.

> Source/WebCore/platform/mac/MemoryPressureHandlerMac.mm:72
> +    notify_register_dispatch("com.apple.WebKit.lowMemory", &notifyToken,
> +                             dispatch_get_main_queue(), ^(int) { memoryPressureHandler().respondToMemoryPressure();});

This is not WebKit project style indentation. We don't line up things with parentheses on the line before

I suggest "org.WebKit.lowMemory" instead of "com.apple.WebKit.lowMemory".
Comment 5 Eric Seidel (no email) 2011-06-18 13:33:04 PDT
Comment on attachment 97314 [details]
Proposed patch

Cleared Geoffrey Garen's review+ from obsolete attachment 97314 [details] so that this bug does not appear in http://webkit.org/pending-commit.
Comment 6 Michael Saboff 2011-06-19 05:55:49 PDT
Committed r89214: <http://trac.webkit.org/changeset/89214>