Bug 252263

Summary: [GLib] Get rid of bundled xdgmime
Product: WebKit Reporter: Michael Catanzaro <mcatanzaro>
Component: WebKitGTKAssignee: Nobody <webkit-unassigned>
Status: NEW ---    
Severity: Normal CC: bugs-noreply
Priority: P2    
Version: WebKit Nightly Build   
Hardware: PC   
OS: Linux   

Description Michael Catanzaro 2023-02-14 13:28:35 PST
This is more a goal than something we can do today. Source/ThirdParty/xdgmime is currently used only by MIMETypeRegistryXdg.cpp. We use two functions: xdg_mime_get_mime_type_from_file_name(), which can probably be replaced with one call to g_content_type_guess() with NULL data parameter, and xdg_mime_get_simple_globs(). To drop our bundled xdgmime we would need to expose a new GLib API to replace xdg_mime_get_simple_globs(). We could call it, say, g_content_type_get_preferred_extension(). Then we'd only need our own bundled xdgmime when building against older GLib. (Of course, with newer GLib we'd just wind up using GLib's bundled xdgmime instead, but that's still an improvement.)