Reviewed by Steve.
* Interfaces/IWebErrorPrivate.idl: Added IWebErrorPrivate
* WebError.cpp:
(WebError::QueryInterface): WebError now also implements IWebErrorPrivate
(WebError::sslPeerCertificate): retrieves certificate info from CFError's user info.
* WebError.h:
* WebKit.vcproj/WebKitGUID.vcproj: Added IWebErrorPrivate_i.c
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@25299
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2007-08-29 Ada Chan <adachan@apple.com>
+
+ <rdar://problem/5074612> Added SPI to retrieve certificate info from a WebError.
+
+ Reviewed by Steve.
+
+ * Interfaces/IWebErrorPrivate.idl: Added IWebErrorPrivate
+ * WebError.cpp:
+ (WebError::QueryInterface): WebError now also implements IWebErrorPrivate
+ (WebError::sslPeerCertificate): retrieves certificate info from CFError's user info.
+ * WebError.h:
+ * WebKit.vcproj/WebKitGUID.vcproj: Added IWebErrorPrivate_i.c
+
2007-08-28 Steve Falkenburg <sfalken@apple.com>
<rdar://problem/5079253> Cannot set different margins for the page
cpp_quote("#define WebKitErrorPlugInWillHandleLoad 204")
cpp_quote("#define WebErrorFailingURLKey TEXT(\"WebErrorFailingURLKey\")")
+
+import "oaidl.idl";
+import "ocidl.idl";
+
+[
+ object,
+ oleautomation,
+ uuid(19FED49C-7016-48a6-B5C6-07ADE116531B),
+ pointer_default(unique)
+]
+
+interface IWebErrorPrivate : IUnknown
+{
+ HRESULT sslPeerCertificate([out, retval] OLE_HANDLE* result);
+}
#include "WebError.h"
#include "WebKit.h"
+#include <WebKitSystemInterface/WebKitSystemInterface.h>
#pragma warning(push, 0)
#include <WebCore/BString.h>
#pragma warning(pop)
{
*ppvObject = 0;
if (IsEqualGUID(riid, IID_IUnknown))
- *ppvObject = static_cast<IUnknown*>(this);
+ *ppvObject = static_cast<IWebError*>(this);
else if (IsEqualGUID(riid, CLSID_WebError))
*ppvObject = static_cast<WebError*>(this);
else if (IsEqualGUID(riid, IID_IWebError))
*ppvObject = static_cast<IWebError*>(this);
+ else if (IsEqualGUID(riid, IID_IWebErrorPrivate))
+ *ppvObject = static_cast<IWebErrorPrivate*>(this);
else
return E_NOINTERFACE;
return S_OK;
}
+HRESULT STDMETHODCALLTYPE WebError::sslPeerCertificate(
+ /* [retval][out] */ OLE_HANDLE* result)
+{
+ if (!result)
+ return E_POINTER;
+ *result = 0;
+
+ if (!m_cfErrorUserInfoDict) {
+ // copy userinfo from CFErrorRef
+ CFErrorRef cfError = m_error;
+ m_cfErrorUserInfoDict.adoptCF(CFErrorCopyUserInfo(cfError));
+ }
+
+ if (!m_cfErrorUserInfoDict)
+ return E_FAIL;
+
+ void* data = wkGetSSLPeerCertificateData(m_cfErrorUserInfoDict.get());
+ if (!data)
+ return E_FAIL;
+ *result = (OLE_HANDLE)(ULONG64)data;
+ return *result ? S_OK : E_FAIL;
+}
+
const ResourceError& WebError::resourceError() const
{
return m_error;
#define WebError_h
#include "IWebError.h"
+#include "IWebErrorPrivate.h"
#pragma warning(push, 0)
#include <WebCore/COMPtr.h>
#include <WebCore/ResourceError.h>
#pragma warning(pop)
-class WebError : public IWebError {
+class WebError : public IWebError, IWebErrorPrivate {
public:
static WebError* createInstance(const WebCore::ResourceError&, IPropertyBag* userInfo = 0);
protected:
virtual HRESULT STDMETHODCALLTYPE isPolicyChangeError(
/* [retval][out] */ BOOL *result);
+ // IWebErrorPrivate
+ virtual HRESULT STDMETHODCALLTYPE sslPeerCertificate(
+ /* [retval][out] */ OLE_HANDLE *result);
+
const WebCore::ResourceError& resourceError() const;
private:
ULONG m_refCount;
COMPtr<IPropertyBag> m_userInfo;
+ RetainPtr<CFDictionaryRef> m_cfErrorUserInfoDict;
WebCore::ResourceError m_error;
};
RelativePath="$(WebKitOutputDir)\obj\WebKit\Interfaces\IWebError_i.c"
>
</File>
+ <File
+ RelativePath="$(WebKitOutputDir)\obj\WebKit\Interfaces\IWebErrorPrivate_i.c"
+ >
+ </File>
<File
RelativePath="$(WebKitOutputDir)\obj\WebKit\Interfaces\IWebFormDelegate_i.c"
>