[webkit-changes] [WebKit/WebKit] 18a97d: [WPE][GTK] Implement portal-based geolocation
Georges Basile Stavracas Neto
noreply at github.com
Wed Mar 6 10:46:09 PST 2024
Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 18a97d248bdc97d770550e8887c4096237e84892
https://github.com/WebKit/WebKit/commit/18a97d248bdc97d770550e8887c4096237e84892
Author: Georges Basile Stavracas Neto <feaneron at igalia.com>
Date: 2024-03-06 (Wed, 06 Mar 2024)
Changed paths:
M Source/WebKit/UIProcess/geoclue/GeoclueGeolocationProvider.cpp
M Source/WebKit/UIProcess/geoclue/GeoclueGeolocationProvider.h
Log Message:
-----------
[WPE][GTK] Implement portal-based geolocation
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
To unsubscribe from these emails, change your notification settings at https://github.com/WebKit/WebKit/settings/notifications
More information about the webkit-changes
mailing list