WebPlatformForEmbedded / libwpe

General-purpose library specifically developed for the WPE-flavored port of WebKit.
BSD 2-Clause "Simplified" License
49 stars 36 forks source link

Add File System API #101

Closed donny-dont closed 2 years ago

donny-dont commented 2 years ago

Allows the application to communicate file system paths to WebKit. Modelled after GLib's directory queries.

donny-dont commented 2 years ago

Currently experimenting with this in https://bugs.webkit.org/show_bug.cgi?id=238382 for the WPE PlayStation backend.

aperezdc commented 2 years ago

While I tend to view this addition favorably, a (small) concern I have is that for the WPE port itself, which exposes the GLib API, we can use the WebKitWebsiteDataManager.base-cache-directory and .base-data-directory properties to configure paths. I suppose we could still consider the paths returned by the handler the defaults, or just never use this API extension in the WPE port (and in this regard it is good that by default the API would be disabled by default in libwpe).

Related to the last thing above: how would code using this API determine at build time whether libwpe has been built with support for it? I suppose we could keep it easy and tell people to use #if __has_include(<wpe/file-system.h>) and skip installing the header when the feature is disabled 🤔

donny-dont commented 2 years ago

Related PR https://github.com/WebKit/WebKit/pull/1033 @aperezdc @zhani

mcatanzaro commented 2 years ago

While I tend to view this addition favorably, a (small) concern I have is that for the WPE port itself, which exposes the GLib API, we can use the WebKitWebsiteDataManager.base-cache-directory and .base-data-directory properties to configure paths. I suppose we could still consider the paths returned by the handler the defaults,

It would be possible to use them as defaults, but frankly seems like a big mismatch vs. how things work.