Expand description
A GeolocationDelegate backend built on GeoClue.
Details about the design:
- This runs as a task on the shared async runtime instead of using a dedicated thread.
Manager.GetClient()returns one client per D-Bus connection, so every page using geolocation in this Servo instance shares a single client. The task multiplexes and keeps one client alive for as long as anything wants a position, requests the highest accuracy asked for, and dispatches each update to all delegate requests.- GeoClue has no one-shot request.
getCurrentPosition()is served by joining the shared client and taking the first position emitted by the stream.
StructsΒ§
- Client
Proxy π - Client
Proxy πBlocking - Geoclue π
- A handle to the task that owns Servoβs connection to GeoClue.
- Geoclue
Task πState - The state of the GeoClue task.
- Location
Proxy π - Location
Proxy πBlocking - Location
Updated π - A
LocationUpdatedsignal. - Location
Updated πArgs LocationUpdatedsignal arguments.- Location
Updated πIterator - A
Iteratorimplementation that yieldsLocationUpdatedsignals. - Location
Updated πStream - A
Streamimplementation that yieldsLocationUpdatedsignals. - Manager
Proxy π - Manager
Proxy πBlocking - Session π
- The live connection to GeoClue, held only while something wants a position.
EnumsΒ§
- Accuracy
Level π - https://www.freedesktop.org/software/geoclue/docs/geoclue-gclue-enums.html
- Request π
- Work handed to the GeoClue task by the delegate.
ConstantsΒ§
- MINIMUM_
PLAUSIBLE_ πALTITUDE - GeoClue reports βno altitudeβ as a very large negative number rather than an absent value. Firefox uses the same cutoff.
StaticsΒ§
- GEOCLUE π
FunctionsΒ§
- convert_
error π - Translate a D-Bus failure into the closest
GeolocationPositionErrorcode, matching the mapping Firefox uses inGeoclueLocationProvider::DBusProxyError. - read_
position π