Skip to main content

Module geoclue

Module geoclue 

Source
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Β§

ClientProxy πŸ”’
ClientProxyBlocking πŸ”’
Geoclue πŸ”’
A handle to the task that owns Servo’s connection to GeoClue.
GeoclueTaskState πŸ”’
The state of the GeoClue task.
LocationProxy πŸ”’
LocationProxyBlocking πŸ”’
LocationUpdated πŸ”’
A LocationUpdated signal.
LocationUpdatedArgs πŸ”’
LocationUpdated signal arguments.
LocationUpdatedIterator πŸ”’
A Iterator implementation that yields LocationUpdated signals.
LocationUpdatedStream πŸ”’
A Stream implementation that yields LocationUpdated signals.
ManagerProxy πŸ”’
ManagerProxyBlocking πŸ”’
Session πŸ”’
The live connection to GeoClue, held only while something wants a position.

EnumsΒ§

AccuracyLevel πŸ”’
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 GeolocationPositionError code, matching the mapping Firefox uses in GeoclueLocationProvider::DBusProxyError.
read_position πŸ”’