WebKit2: Support setting the client certificate on Windows
Created attachment 87378 [details] Patch
Comment on attachment 87378 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=87378&action=review I’m not sure that this is following best practices for platform-specific functions. All those empty ones that say ASSERT_NOT_REACHED seem wrong to me. Can you find another example to check the idiom? Or ask Sam or Anders? > Source/WebKit2/Shared/API/c/win/WKCertificateInfoWin.cpp:37 > + RefPtr<WebCertificateInfo> certificateInfo = WebCertificateInfo::create(PlatformCertificateInfo(certificate)); > + return toAPI(certificateInfo.release().releaseRef()); Should use leakRef rather than releaseRef. The name releaseRef is deprecated, I just haven’t had a chance to remove it yet. I also think writing this as a 1-liner would be better. > Source/WebKit2/WebProcess/InjectedBundle/win/InjectedBundleWin.cpp:34 > +#if USE(CFNETWORK) > +#include <WebCore/CertificateCFWin.h> > +#endif Conditional includes should go in a separate paragraph after the rest of the includes. > Source/WebKit2/WebProcess/InjectedBundle/win/InjectedBundleWin.cpp:114 > + RetainPtr<CFDataRef> certificate = WebCore::copyCertificateToData(certificateChain.first()); > + ResourceHandle::setClientCertificate(host, certificate.get()); I think this would read better as a one-liner.
(In reply to comment #2) > (From update of attachment 87378 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=87378&action=review > > I’m not sure that this is following best practices for platform-specific functions. All those empty ones that say ASSERT_NOT_REACHED seem wrong to me. Can you find another example to check the idiom? Or ask Sam or Anders? Anders says: "if we know that they're only used on windows, we should PLATFORM(WIN) them, and add WKBundleSetClientCertificate to WKBundlePrivateWin.h" This also applies to InjectedBundle::setHostAllowsANyHTTPSCertificate(), which is a Windows-only API which I added in another recent patch. I'm going to land this patch as-is (after addressing your other comments) and move both these functions to be Windows-only in another patch.
Committed r82309: <http://trac.webkit.org/changeset/82309>