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

Mario Sanchez Prada msanchez at igalia.com
Wed Apr 4 02:17:08 PDT 2012

On Tue, 2012-04-03 at 08:31 -0700, Martin Robinson wrote:
> It is true that a 'download' action exists for a new decision type
> that it doesn't make sense for. Consider that it already only ever
> makes sense for WebkitResponsePolicyDecisions. Take a look at the
> documentation in WebKitWebView.h. Right now 'download' is available
> for all decisions, because this is the way the C API works.
> If you insist that it must only be available for the one decision
> type, then why not consider this counter-proposal:
> 1. Accept my proposal above, without the 'download' method.
> 2. Add a webkit_response_policy_decision_download method to
> WebKitResponsePolicyDecision.

I think that might work. It's basically a mix of the two proposals I
made, having the PolicyDecisionListener in one hand to abstract the
actual object we'd be delegating in, while at the same time getting rid
of the download() method in the PolicyDecision class, while still not
creating the new FramePolicyDecision class.

Am I understanding you right?

> > To be honest, I had already a hard time understanding why this
> > download() method was both in WebKitGTK+ [1] and WebKit2GTK+ APIs [2],
> > since it sounded strange to me that you could "use" and "ignore" a
> > 'policy decision', but also "download" it :-).
> The answer to this is simple: being able to 'download' is an important usecase.

I agree it's an important use case _if_ we think of this Policy Decision
framework as a wrapper of the internal Policy Client, but not if we
think of it as something more generic.

> > However, I can see also the point of keeping consistency between
> > WebKitGTK+ and WebKit2GTK+ APIs, and so that would lean us towards
> > keeping the download() method here... but in that case I wonder whether
> > it wouldn't be perhaps better to accept that this "policy decision
> > framework" is just a wrapper for the internal Policy Clilent, and then
> > implement "geolocation permission requests" completely out of this
> > framework, as it's done in WebKitGTK+.
> Here is where you lose me. It is possible that geolocation requests do
> not fit into the policy decision framework, but not because of this
> issue. I say this because the issue already existed with
> WebKitNavigationPolicyDecision, WebKitNavigationPolicyDecision, the C
> API and WebKit1. It's not a new thing. :)

I probably did a poor explanation. Will try again...

I agree with you that this issue shouldn't be The Reason for not
implementing this inside the policy decision framework. However, the
more I see the whole thing the more I think we should implement it
completely out of it because I feel like it does not fit well there,
something you also seem to agree with :-)


More information about the webkit-gtk mailing list