async WebPolicyDelegate do not work I was trying to make an async WebPolicyDelegate this afternoon. No such luck. See attached application. WebCore definitely seems to assume the WebPolicyDelegate is synchronous: m_delegateIsDecidingNavigationPolicy = true; m_client->dispatchDecidePolicyForNavigationAction(&FrameLoader::continueAfterNavigationPolicy, action, request); m_delegateIsDecidingNavigationPolicy = false; This is directly in conflict with the documentation in WebPolicyDelegate.h: /*! @protocol WebPolicyDecisionListener @discussion This protocol is used to call back with the results of a policy decision. This provides the ability to make these decisions asyncrhonously, which means the decision can be made by prompting with a sheet, for example. */
Created attachment 20654 [details] test application showing failure
2008-04-17 17:38:39.186 PolicyTest[80860:10b] *** -[WebFramePolicyListener <null selector>]: unrecognized selector sent to instance 0x12f630 2008-04-17 17:38:39.188 PolicyTest[80860:10b] *** -[WebFramePolicyListener <null selector>]: unrecognized selector sent to instance 0x12f630 .... diff -r -u PolicyTest/TestPolicyDelegate.m PolicyTest/TestPolicyDelegate.m --- PolicyTest/TestPolicyDelegate.m 2008-04-17 16:23:37.000000000 -0700 +++ PolicyTest/TestPolicyDelegate.m 2008-04-17 17:40:39.000000000 -0700 @@ -31,6 +31,7 @@ NSMethodSignature *signature = [decisionListener methodSignatureForSelector:@selector(use)]; NSInvocation *invocation = [NSInvocation invocationWithMethodSignature:signature]; [invocation setTarget:listener]; + [invocation setSelector:@selector(use)]; [NSTimer scheduledTimerWithTimeInterval:1 invocation:invocation repeats:NO]; }