Electrolysis/Geolocation: Difference between revisions

From MozillaWiki
Jump to navigation Jump to search
m (Formatting)
mNo edit summary
Line 1: Line 1:
The only content-facing bits are in [[http://mxr.mozilla.org/mozilla-central/source/dom/interfaces/geolocation/nsIDOMGeoGeolocation.idl|nsIDOMGeoGeolocation.idl]], ie:
The only content-facing bits are in [http://mxr.mozilla.org/mozilla-central/source/dom/interfaces/geolocation/nsIDOMGeoGeolocation.idl nsIDOMGeoGeolocation.idl], ie:


   void getCurrentPosition(nsIDOMGeoPositionCallback successCallback,
   void getCurrentPosition(nsIDOMGeoPositionCallback successCallback,

Revision as of 01:21, 24 March 2010

The only content-facing bits are in nsIDOMGeoGeolocation.idl, ie:

 void getCurrentPosition(nsIDOMGeoPositionCallback successCallback,
                         nsIDOMGeoPositionErrorCallback errorCallback,
                         nsIDOMGeoPositionOptions options);
 long watchPosition(nsIDOMGeoPositionCallback successCallback,
                    nsIDOMGeoPositionErrorCallback errorCallback,
                    nsIDOMGeoPositionOptions options);
 void clearWatch(long watchId);

The content process can create a GeoRequest actor that encapsulates and dispatches an asynchronous operation to the chrome process, which destroys the actor on completion, triggering the proper callback in content.

The only other work that really needs to be done AFAICT is proxying the operations on the nsGeolocationService object. There can either be separate nsGeolocationService objects for chrome/content, otherwise each method can check for a valid PContentProcessParent member and delegate through IPDL.