[WPE][GTK] Implement portal-based geolocation#25496
Conversation
|
EWS run on previous version of this PR (hash 52a1cf4) Details
|
There was a problem hiding this comment.
You don't think it's worth adding a small callback just to print any potential error? Could be useful in the future if something goes unexpectedly wrong. (I wouldn't pass the GeoclueGeolocationProvider since you surely don't want to keep it alive for the callback or bother with the cancellable here. I would just print a warning if the call fails and do nothing else.)
There was a problem hiding this comment.
For the Close method, specifically, I don't think it's worth. Because the Session may have been closed already on the bus, due to a number of external reasons. So it'll log a scary warning for something that's essentially harmless, and outside of WebKit's control.
For the other calls below, I think it's a good idea. Will do.
52a1cf4 to
c6d1734
Compare
|
EWS run on current version of this PR (hash c6d1734) Details
|
https://bugs.webkit.org/show_bug.cgi?id=220253 Reviewed by Michael Catanzaro. This turned into a somewhat messy patch, but the principle behind it is to try and use the Location portal first, and fallback to the direct Geoclue calls that it already does. The Location portal has two particular steps: (1) create a geolocation session, and (2) start the session and get geolocation updates. Step 1 is where the location accuracy is set. For this reason, unlike the direct Geoclue code path, we have to close and recreate the Location portal session when high accuracy mode changes. Talking about high accuracy mode, apparently the new value was never stored into m_isHighAccuracyEnabled! This is fixed in this patch too. Step 2 is where the Location session is started. Only after this call that we'd receive geolocation position updates. In theory we'd be able to pass a parent window handler in this step, and that would allow the desktop environment to nicely place access control requests on it; that is not currently supported by WebKit though, so just pass empty string for now. The destroy timer is used to release both Portal and Geoclue resources so name the timer and the corresponding methods to match that. Also rename Geoclue-specific methods to explicitly mention Geoclue, which helps following the callback chain. * Source/WebKit/UIProcess/geoclue/GeoclueGeolocationProvider.cpp: (WebKit::GeoclueGeolocationProvider::GeoclueGeolocationProvider): (WebKit::GeoclueGeolocationProvider::start): (WebKit::GeoclueGeolocationProvider::stop): (WebKit::GeoclueGeolocationProvider::setEnableHighAccuracy): (WebKit::GeoclueGeolocationProvider::destroyStateLater): (WebKit::GeoclueGeolocationProvider::destroyState): (WebKit::GeoclueGeolocationProvider::acquirePortalProxy): (WebKit::GeoclueGeolocationProvider::setupPortalProxy): (WebKit::GeoclueGeolocationProvider::createPortalSession): (WebKit::GeoclueGeolocationProvider::startPortalSession): (WebKit::GeoclueGeolocationProvider::portalLocationUpdated): (WebKit::GeoclueGeolocationProvider::stopPortalSession): (WebKit::GeoclueGeolocationProvider::createGeoclueManager): (WebKit::GeoclueGeolocationProvider::setupGeoclueManager): (WebKit::GeoclueGeolocationProvider::createGeoclueClient): (WebKit::GeoclueGeolocationProvider::setupGeoclueClient): (WebKit::GeoclueGeolocationProvider::startGeoclueClient): (WebKit::GeoclueGeolocationProvider::stopGeoclueClient): (WebKit::GeoclueGeolocationProvider::requestAccuracyLevel): (WebKit::GeoclueGeolocationProvider::destroyManagerLater): Deleted. (WebKit::GeoclueGeolocationProvider::destroyManager): Deleted. (WebKit::GeoclueGeolocationProvider::setupManager): Deleted. (WebKit::GeoclueGeolocationProvider::createClient): Deleted. (WebKit::GeoclueGeolocationProvider::setupClient): Deleted. (WebKit::GeoclueGeolocationProvider::startClient): Deleted. (WebKit::GeoclueGeolocationProvider::stopClient): Deleted. * Source/WebKit/UIProcess/geoclue/GeoclueGeolocationProvider.h: Canonical link: https://commits.webkit.org/275746@main
c6d1734 to
18a97d2
Compare
|
Committed 275746@main (18a97d2): https://commits.webkit.org/275746@main Reviewed commits have been landed. Closing PR #25496 and removing active labels. |
18a97d2
c6d1734
🧪 ios-wk2-wpt🛠 tv-sim