Privacy/Reviews/GeolocationAPI: Difference between revisions

Line 42: Line 42:
Describe any major components in the system and how they interact.  Also include any third-party APIs (those Mozilla does not control) and what type of data is sent or received via those APIs.
Describe any major components in the system and how they interact.  Also include any third-party APIs (those Mozilla does not control) and what type of data is sent or received via those APIs.


'''NOTE:  
There are three components:
- All Location data mentioned in this section may pertain to the user's location data (retrieved by another function), or to any arbitrary location data.  
# The content (untrusted) page requesting the location
- Location data in this context is equivalent to the coordinates interface as described in the W3C Geolocation API documentation here:
# The Geolocation API (Gecko)
    http://dev.w3.org/geo/api/spec-source.html#coordinates_interface'''
# The Reverse Geocoding service (e.g., Google)
 
'''NOTE:'''
* All Location data mentioned in this section may pertain to the user's location data (retrieved by another function), or to any arbitrary location data.  
* Location data in this context is equivalent to the coordinates interface as described in the W3C Geolocation API documentation here: http://dev.w3.org/geo/api/spec-source.html#coordinates_interface


===Page Holding Location Request===
===Page Holding Location Request===
Line 63: Line 67:
|-
|-
| ''In:''  
| ''In:''  
| success callback function (defined in application's Javascript)
| successCallback
| Civic address data
| Civic address data
|  
| Callback is defined in application's Javascript
|-
|-
| ''Out:''  
| ''Out:''  
Line 79: Line 83:
This is a browser component in privileged code that brokers communication between the page requesting the location information and the third party location services. This component begins to handle the request by asking the user for permission to use geolocation.
This is a browser component in privileged code that brokers communication between the page requesting the location information and the third party location services. This component begins to handle the request by asking the user for permission to use geolocation.


''Not sure if we should be asking for permission if website is not requesting the user's location (ie. just converting an arbitrary location into a civic address)''
This API will prompt the user for permission even if website is not requesting the user's location (ie. just converting an arbitrary location into a civic address).  This is because it calls a third-party API with arbitrary data. We are planning to have the implementation only ask permission if the user has not currently authorized other geolocation activity on the page.
 
''Sid: Yes, we should ask if the user has not beem prompted for that siteDo we allow third party content (iframes on the page, for instance) to invoke this API?''
 
''We are planning to have the implementation only ask permission if the user has not currently authorized other geolocation activity on the page.''


If permission is given, this request is processed, and the location's lat/long is then sent to the platform's reverse geocoding API (if available).  If not, the request is not performed, and the interaction stops here.
If permission is given, this request is processed, and the location's lat/long is then sent to the platform's reverse geocoding API (if available).  If not, the request is not performed, and the interaction stops here.
Line 94: Line 94:
! Where
! Where
|-
|-
| Location data  
| Location data: nsIDOMGeoPositionCoords object
| nsIDOMGeoPositionCoords object stored as an nsCOMPtr property in the request object
| stored as an nsCOMPtr property in the request object (memory only)
|}
|}


Line 114: Line 114:
|-
|-
| ''In:''  
| ''In:''  
| 3rd party API (such as Android's getFromLocation) return point
| Return from Geocode API
| Address object(s), which are converted to the general form described below
| Address object(s)
|
| return from 3rd party API (such as Android's getFromLocation)
|-
|-
| ''Out:''  
| ''Out:''  
| 3rd party API (such as Android's getFromLocation) entry point
| Call to Geocoding API
| Latitude and longitude from user's location data ONLY
| Latitude and longitude
|
| 3rd party API (such as Android's getFromLocation)
|}
|}


''The 3rd party APIs vary from platform to platform, but we would only ever be handing over the latitude and longitude to these 3rd party APIs. For example, on the Android platform, we use a call to getFromLocation(double, double, int) (documented here: http://developer.android.com/reference/android/location/Geocoder.html).  
The 3rd party APIs vary from platform to platform, but we would only ever be handing over the latitude and longitude to these 3rd party APIs. For example, on the Android platform, we use a call to getFromLocation(double, double, int) (documented here: http://developer.android.com/reference/android/location/Geocoder.html).  


This call would return a list of Address objects, which should be of the general form that is documented here: http://arreth.wordpress.com/2012/03/13/proposed-changes-to-geolocation-api-specification/  
This call would return a list of Address objects, which should be of the general form that is documented here: http://arreth.wordpress.com/2012/03/13/proposed-changes-to-geolocation-api-specification/  


On the Android platform, the Address objects are of the form documented here: http://developer.android.com/reference/android/location/Address.html'''
On the Android platform, the Address objects are of the form documented here: http://developer.android.com/reference/android/location/Address.html


===Platform Reverse Geocoding API (3rd-Party)===
===Platform Reverse Geocoding API (3rd-Party)===
canmove, Confirmed users
1,537

edits