WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
NEW
206077
MemoryPressureHandler should handle more than one callback
https://bugs.webkit.org/show_bug.cgi?id=206077
Summary
MemoryPressureHandler should handle more than one callback
Ben Nham
Reported
2020-01-10 11:00:18 PST
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.
Attachments
Add attachment
proposed patch, testcase, etc.
Radar WebKit Bug Importer
Comment 1
2020-01-10 11:00:46 PST
<
rdar://problem/58484110
>
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug