[webkit-gtk] WK2: Adapting the Policy Decision Framework for Geolocation

Carlos Garcia Campos cgarcia at igalia.com
Mon Apr 2 01:39:46 PDT 2012

El lun, 02-04-2012 a las 09:11 +0200, Carlos Garcia Campos escribió:
> I simpler approach would be:
>  - Rename use()/ignore() to accept()/reject() or allow()/deny().
>  - Add WKGeolocationPermissionRequestRef attribute to
> WebKitPolicyDecision and
> webkitPolicyDecisionSetGeolocationPermissionRequest().
>  - Add WebKitGeolocationPolicyDecision that calls
> webkitPolicyDecisionSetGeolocationPermissionRequest() when created.
>  - That way WebKitPolicyDecision will always have either a listener or a
> geolocation request, and it will use whatever it has, doing nothing in
> download() if listener is NULL.
>  - Document that download() doesn't make sense for geolocation
> decisions, if it's not obvious enough.

Btw, I'm proposing this a simpler solution, because the download problem
is present in the current API too. But conceptually, I agree with the
option1, with a minor change. Since geolocation requests are very
different than frame policy decisions, maybe it would be better to use
an interface for WebKitPolicyDecision instead of an abstract class. That
way concrete objects will implement the interface instead of inheriting
from a common parent. The idea and the result is indeed the same. 



WebKitFramePolicyDecision (I can't think of a better name either)

Implements accept() and reject() and adds download()

WebKitResponsePolicyDecision and WebKitNavigationPolicyDecision would
simply inherit from WebKitFramePolicyDecision.

WebKitGeolocationPolicyDecision implements accept() and reject()

Both solutions look good to me, the first one is simpler (the code and
the API exposed), but if you think the download() is an important
problem, this second one would be fine with me too.

Carlos Garcia Campos
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part
URL: <http://lists.webkit.org/pipermail/webkit-gtk/attachments/20120402/87a58f9e/attachment.bin>

More information about the webkit-gtk mailing list