[Webkit-unassigned] [Bug 32499] Add client based Geolocation provider

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Sun Dec 13 16:59:35 PST 2009


https://bugs.webkit.org/show_bug.cgi?id=32499


mitz at webkit.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #44768|review?                     |review-
               Flag|                            |




--- Comment #3 from mitz at webkit.org  2009-12-13 16:59:35 PST ---
(From update of attachment 44768)
CLIENT_BASED_GEOLOCATION is not a platform feature, so it’s not appropriate to
guard it with USE(). Please use ENABLE(CLIENT_BASED_GEOLOCATION) (or maybe
CLIENT_GEOLOCATION_PROVIDER).

> +        Add client based Geolocation provider

Not sure Geolocation needs to be capitalized here.

> +static PassRefPtr<Geoposition> createGeopositionFromGeolocationPosition(GeolocationPosition* position)

You can call this createGeoposition().

> +static PassRefPtr<PositionError> createPositionErrorFromGeolocationError(GeolocationError* error)

You can call this createGeoposition().

> +void Geolocation::positionChanged()

I think this method should take a PassRefPtr<Geoposition> and set
m_currentPosition to it. Both call sites know the Geoposition.

> +void Geolocation::positionChanged(GeolocationPosition* position)

I’d call this setPosition().

> +void Geolocation::errorOccurred(GeolocationError* error)

And I’d call this setError().

> +    RefPtr<Geoposition> m_lastPosition;

This variable isn’t necessary.

> +    HashSet<RefPtr<Geolocation> >::const_iterator it = m_observers.begin();
> +    HashSet<RefPtr<Geolocation> >::const_iterator end = m_observers.end();
> +    for (; it != end; ++it)

Normally the loop variable is defined and initialized in the for statement.

> +    enum ErrorCode {
> +        PermissionDenied,
> +        PositionUnavailable
> +    };

It’s strange to call these “codes” but I don’t have a better suggestion.

>  #if ENABLE(NOTIFICATIONS)
>      class NotificationPresenter;
>  #endif
> +#if ENABLE(CLIENT_BASED_GEOLOCATION)
> +    class NotificationPresenter;
> +#endif

Please combine these into a single #if ENABLE(NOTIFICATIONS) ||
ENABLE(CLIENT_BASED_GEOLOCATION).

> +#if USE(CLIENT_BASED_GEOLOCATION)
> +        GeolocationController* geolocationController() const { return m_geolocationController.get(); }
> +#endif

Can this return a GeolocationController&? Seems like it should never be 0.
Which makes me wonder why it’s referenced by pointer and allocated dynamically
instead of being a member of Page. However, this is consistent with other
clients so I’m not asking that you change it.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.


More information about the webkit-unassigned mailing list