[webkit-reviews] review denied: [Bug 32499] Add client based Geolocation provider : [Attachment 44768] Patch

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


mitz at webkit.org has denied Sam Weinig <sam at webkit.org>'s request for review:
Bug 32499: Add client based Geolocation provider
https://bugs.webkit.org/show_bug.cgi?id=32499

Attachment 44768: Patch
https://bugs.webkit.org/attachment.cgi?id=44768&action=review

------- Additional Comments from mitz at webkit.org
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.


More information about the webkit-reviews mailing list