[Webkit-unassigned] [Bug 206077] New: MemoryPressureHandler should handle more than one callback

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Jan 10 11:00:18 PST 2020


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

            Bug ID: 206077
           Summary: MemoryPressureHandler should handle more than one
                    callback
           Product: WebKit
           Version: WebKit Nightly Build
          Hardware: Unspecified
                OS: Unspecified
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: Web Template Framework
          Assignee: webkit-unassigned at lists.webkit.org
          Reporter: nham at apple.com

Currently MemoryPressureHandler only stores a single callback lambda. This causes issues with the common pattern of setting the lambda for the singleton MemoryPressureHandler.

For instance, all of these callsites do the equivalent of MemoryPressureHandler::singleton().setLowMemoryHandler in the UI process:

1. Legacy WebView init in WebInstallMemoryPressureHandler
2. WebProcessPool init in WebProcessPool::platformInitialize
3. +[NSAttributedString retrieveOrCreateWebview] used by all of the +[NSAttributedString loadFromHTMLWith...] APIs

So for instance, if your app creates a WKWebView, and then calls +[NSAttributedString loadFromHTMLWithRequest:options:completionHandler:], then the WebProcessPool low memory handler installed by WKWebView gets overwritten by the NSAttributedString low memory handler, which seems undesirable.

There's a FIXME about this in WebProcessPool, so we should probably make it harder to trample on an existing memory pressure handler, or just allow multiple callbacks to be attached to a single memory pressure handler.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20200110/c6704b60/attachment-0001.htm>


More information about the webkit-unassigned mailing list