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. WebKitPolicyDecision webkit_policy_decision_accept(); webkit_policy_decision_reject(); 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 http://pgp.rediris.es:11371/pks/lookup?op=get&search=0xF3D322D0EC4582C3
signature.asc
Description: This is a digitally signed message part
_______________________________________________ webkit-gtk mailing list [email protected] http://lists.webkit.org/mailman/listinfo.cgi/webkit-gtk
