Commit c368c886 authored by weinig@apple.com's avatar weinig@apple.com

Make certificate data available to the WKFrameRef after it is committed

Part of <rdar://problem/8350189>
https://bugs.webkit.org/show_bug.cgi?id=45998

Reviewed by Anders Carlsson.

* Shared/APIObject.h:
Add new type.

* Shared/WebCertificateInfo.h: Added.
(WebKit::WebCertificateInfo::create):
(WebKit::WebCertificateInfo::platformCertificateInfo):
(WebKit::WebCertificateInfo::WebCertificateInfo):
(WebKit::WebCertificateInfo::type):
Add API type for vending.

* Shared/mac/PlatformCertificateInfo.h: Added.
(WebKit::PlatformCertificateInfo::peerCertificates):
* Shared/mac/PlatformCertificateInfo.mm: Added.
(WebKit::PlatformCertificateInfo::PlatformCertificateInfo):
(WebKit::PlatformCertificateInfo::encode):
(WebKit::PlatformCertificateInfo::decode):
(WebKit::PlatformCertificateInfo::dump):
* Shared/qt/PlatformCertificateInfo.h: Added.
(WebKit::PlatformCertificateInfo::PlatformCertificateInfo):
(WebKit::PlatformCertificateInfo::encode):
(WebKit::PlatformCertificateInfo::decode):
* Shared/win/PlatformCertificateInfo.h: Added.
(WebKit::PlatformCertificateInfo::PlatformCertificateInfo):
(WebKit::PlatformCertificateInfo::encode):
(WebKit::PlatformCertificateInfo::decode):
Add platform specific holder for certificate data and encode/decode functions
to send it over the wire. Right now, this only implemented for the mac.

* UIProcess/API/C/WKAPICast.h:
* UIProcess/API/C/WKBase.h:
* UIProcess/API/C/WKCertificateInfo.cpp: Added.
(WKCertificateInfoGetTypeID):
* UIProcess/API/C/WKCertificateInfo.h: Added.
Add wrapper for WebCertificateInfo.

* UIProcess/API/C/WKFrame.cpp:
(WKFrameGetCertificateInfo):
* UIProcess/API/C/WKFrame.h:
Add getter for a WKCertificateInfo.

* UIProcess/API/C/mac/WKCertificateInfoMac.h: Added.
* UIProcess/API/C/mac/WKCertificateInfoMac.mm: Added.
(WKCertificateInfoGetPeerCertificates):
Add mac specific getters for the platform specific certificate
data.

* UIProcess/WebFrameProxy.cpp:
(WebKit::WebFrameProxy::setCertificateInfo):
* UIProcess/WebFrameProxy.h:
(WebKit::WebFrameProxy::certificateInfo):
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::didReceiveMessage):
(WebKit::WebPageProxy::didCommitLoadForFrame):
* UIProcess/WebPageProxy.h:
* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::WebFrameLoaderClient::dispatchDidCommitLoad):
* WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
Pipe the certificate info through to the WebFrameProxy on
commit.

* WebKit2.pro:
* WebKit2.xcodeproj/project.pbxproj:
* win/WebKit2.vcproj:
* win/WebKit2Generated.make:
Add new files.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@67760 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 11c960b4
2010-09-17 Sam Weinig <sam@webkit.org>
Reviewed by Anders Carlsson.
Make certificate data available to the WKFrameRef after it is committed
Part of <rdar://problem/8350189>
https://bugs.webkit.org/show_bug.cgi?id=45998
* Shared/APIObject.h:
Add new type.
* Shared/WebCertificateInfo.h: Added.
(WebKit::WebCertificateInfo::create):
(WebKit::WebCertificateInfo::platformCertificateInfo):
(WebKit::WebCertificateInfo::WebCertificateInfo):
(WebKit::WebCertificateInfo::type):
Add API type for vending.
* Shared/mac/PlatformCertificateInfo.h: Added.
(WebKit::PlatformCertificateInfo::peerCertificates):
* Shared/mac/PlatformCertificateInfo.mm: Added.
(WebKit::PlatformCertificateInfo::PlatformCertificateInfo):
(WebKit::PlatformCertificateInfo::encode):
(WebKit::PlatformCertificateInfo::decode):
(WebKit::PlatformCertificateInfo::dump):
* Shared/qt/PlatformCertificateInfo.h: Added.
(WebKit::PlatformCertificateInfo::PlatformCertificateInfo):
(WebKit::PlatformCertificateInfo::encode):
(WebKit::PlatformCertificateInfo::decode):
* Shared/win/PlatformCertificateInfo.h: Added.
(WebKit::PlatformCertificateInfo::PlatformCertificateInfo):
(WebKit::PlatformCertificateInfo::encode):
(WebKit::PlatformCertificateInfo::decode):
Add platform specific holder for certificate data and encode/decode functions
to send it over the wire. Right now, this only implemented for the mac.
* UIProcess/API/C/WKAPICast.h:
* UIProcess/API/C/WKBase.h:
* UIProcess/API/C/WKCertificateInfo.cpp: Added.
(WKCertificateInfoGetTypeID):
* UIProcess/API/C/WKCertificateInfo.h: Added.
Add wrapper for WebCertificateInfo.
* UIProcess/API/C/WKFrame.cpp:
(WKFrameGetCertificateInfo):
* UIProcess/API/C/WKFrame.h:
Add getter for a WKCertificateInfo.
* UIProcess/API/C/mac/WKCertificateInfoMac.h: Added.
* UIProcess/API/C/mac/WKCertificateInfoMac.mm: Added.
(WKCertificateInfoGetPeerCertificates):
Add mac specific getters for the platform specific certificate
data.
* UIProcess/WebFrameProxy.cpp:
(WebKit::WebFrameProxy::setCertificateInfo):
* UIProcess/WebFrameProxy.h:
(WebKit::WebFrameProxy::certificateInfo):
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::didReceiveMessage):
(WebKit::WebPageProxy::didCommitLoadForFrame):
* UIProcess/WebPageProxy.h:
* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::WebFrameLoaderClient::dispatchDidCommitLoad):
* WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
Pipe the certificate info through to the WebFrameProxy on
commit.
* WebKit2.pro:
* WebKit2.xcodeproj/project.pbxproj:
* win/WebKit2.vcproj:
* win/WebKit2Generated.make:
Add new files.
2010-09-17 Matthew Delaney <mdelaney@apple.com>
Reviewed by Simon Fraser.
......
......@@ -34,8 +34,9 @@ class APIObject : public RefCounted<APIObject> {
public:
enum Type {
// Base types
TypeNull,
TypeNull = 0,
TypeArray,
TypeCertificateInfo,
TypeData,
TypeDictionary,
TypeError,
......
/*
* Copyright (C) 2010 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
* THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef WebCertificateInfo_h
#define WebCertificateInfo_h
#include "APIObject.h"
#include "PlatformCertificateInfo.h"
#include <wtf/PassRefPtr.h>
namespace WebKit {
class WebCertificateInfo : public APIObject {
public:
static const Type APIType = TypeCertificateInfo;
static PassRefPtr<WebCertificateInfo> create(const PlatformCertificateInfo& info)
{
return adoptRef(new WebCertificateInfo(info));
}
const PlatformCertificateInfo& platformCertificateInfo() const { return m_platformCertificateInfo; }
private:
explicit WebCertificateInfo(const PlatformCertificateInfo& info)
: m_platformCertificateInfo(info)
{
}
virtual Type type() const { return APIType; }
PlatformCertificateInfo m_platformCertificateInfo;
};
} // namespace WebKit
#endif // WebCertificateInfo_h
/*
* Copyright (C) 2010 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
* THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef PlatformCertificateInfo_h
#define PlatformCertificateInfo_h
#include <WebCore/ResourceResponse.h>
#include <wtf/RetainPtr.h>
namespace CoreIPC {
class ArgumentDecoder;
class ArgumentEncoder;
}
namespace WebKit {
class PlatformCertificateInfo {
public:
PlatformCertificateInfo();
explicit PlatformCertificateInfo(const WebCore::ResourceResponse&);
CFArrayRef peerCertificates() const { return m_peerCertificates.get(); }
void encode(CoreIPC::ArgumentEncoder* encoder) const;
static bool decode(CoreIPC::ArgumentDecoder* decoder, PlatformCertificateInfo& t);
#ifndef NDEBUG
void dump() const;
#endif
private:
RetainPtr<CFArrayRef> m_peerCertificates;
};
} // namespace WebKit
#endif // PlatformCertificateInfo_h
/*
* Copyright (C) 2010 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
* THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "PlatformCertificateInfo.h"
#include "ArgumentDecoder.h"
#include "ArgumentEncoder.h"
#include <WebKitSystemInterface.h>
#include <Security/Security.h>
using namespace WebCore;
namespace WebKit {
PlatformCertificateInfo::PlatformCertificateInfo()
{
}
PlatformCertificateInfo::PlatformCertificateInfo(const ResourceResponse& response)
: m_peerCertificates(AdoptCF, WKCopyNSURLResponsePeerCertificates(response.nsURLResponse()))
{
}
void PlatformCertificateInfo::encode(CoreIPC::ArgumentEncoder* encoder) const
{
// Special case no certificates,
if (!m_peerCertificates) {
encoder->encodeUInt64(std::numeric_limits<uint64_t>::max());
return;
}
uint64_t length = CFArrayGetCount(m_peerCertificates.get());
encoder->encodeUInt64(length);
for (size_t i = 0; i < length; ++i) {
RetainPtr<CFDataRef> data(AdoptCF, SecCertificateCopyData((SecCertificateRef)CFArrayGetValueAtIndex(m_peerCertificates.get(), i)));
encoder->encodeBytes(CFDataGetBytePtr(data.get()), CFDataGetLength(data.get()));
}
}
bool PlatformCertificateInfo::decode(CoreIPC::ArgumentDecoder* decoder, PlatformCertificateInfo& c)
{
uint64_t length;
if (!decoder->decode(length))
return false;
if (length == std::numeric_limits<uint64_t>::max()) {
// This is the no certificates case.
return true;
}
RetainPtr<CFMutableArrayRef> array(AdoptCF, CFArrayCreateMutable(0, length, &kCFTypeArrayCallBacks));
for (size_t i = 0; i < length; ++i) {
Vector<uint8_t> bytes;
if (!decoder->decodeBytes(bytes))
return false;
RetainPtr<CFDataRef> data(AdoptCF, CFDataCreateWithBytesNoCopy(0, bytes.data(), bytes.size(), kCFAllocatorNull));
RetainPtr<SecCertificateRef> certificate(AdoptCF, SecCertificateCreateWithData(0, data.get()));
CFArrayAppendValue(array.get(), certificate.get());
}
c.m_peerCertificates = array;
return true;
}
#ifndef NDEBUG
void PlatformCertificateInfo::dump() const
{
unsigned entries = m_peerCertificates ? CFArrayGetCount(m_peerCertificates.get()) : 0;
NSLog(@"PlatformCertificateInfo\n");
NSLog(@" Entries: %d\n", entries);
for (unsigned i = 0; i < entries; ++i) {
RetainPtr<CFStringRef> summary(AdoptCF, SecCertificateCopySubjectSummary((SecCertificateRef)CFArrayGetValueAtIndex(m_peerCertificates.get(), i)));
NSLog(@" %@", (NSString *)summary.get());
}
}
#endif
} // namespace WebKit
/*
* Copyright (C) 2010 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
* THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef PlatformCertificateInfo_h
#define PlatformCertificateInfo_h
#include "ArgumentDecoder.h"
#include "ArgumentEncoder.h"
#include <WebCore/ResourceResponse.h>
namespace WebKit {
class PlatformCertificateInfo {
public:
PlatformCertificateInfo()
{
}
explicit PlatformCertificateInfo(const WebCore::ResourceResponse&)
{
}
void encode(CoreIPC::ArgumentEncoder*) const
{
}
static bool decode(CoreIPC::ArgumentDecoder*, PlatformCertificateInfo&)
{
}
};
} // namespace WebKit
#endif // PlatformCertificateInfo_h
/*
* Copyright (C) 2010 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
* THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef PlatformCertificateInfo_h
#define PlatformCertificateInfo_h
#include "ArgumentDecoder.h"
#include "ArgumentEncoder.h"
#include <WebCore/ResourceResponse.h>
namespace WebKit {
class PlatformCertificateInfo {
public:
PlatformCertificateInfo()
{
}
explicit PlatformCertificateInfo(const WebCore::ResourceResponse&)
{
}
void encode(CoreIPC::ArgumentEncoder*) const
{
}
static bool decode(CoreIPC::ArgumentDecoder*, PlatformCertificateInfo&)
{
}
};
} // namespace WebKit
#endif // PlatformCertificateInfo_h
......@@ -47,6 +47,7 @@ class MutableArray;
class MutableDictionary;
class WebBackForwardList;
class WebBackForwardListItem;
class WebCertificateInfo;
class WebContext;
class WebData;
class WebError;
......@@ -66,6 +67,7 @@ template<> struct APITypeInfo<WKArrayRef> { typedef Immuta
template<> struct APITypeInfo<WKBackForwardListItemRef> { typedef WebBackForwardListItem* ImplType; };
template<> struct APITypeInfo<WKBackForwardListRef> { typedef WebBackForwardList* ImplType; };
template<> struct APITypeInfo<WKBooleanRef> { typedef WebBoolean* ImplType; };
template<> struct APITypeInfo<WKCertificateInfoRef> { typedef WebCertificateInfo* ImplType; };
template<> struct APITypeInfo<WKContextRef> { typedef WebContext* ImplType; };
template<> struct APITypeInfo<WKDataRef> { typedef WebData* ImplType; };
template<> struct APITypeInfo<WKDictionaryRef> { typedef ImmutableDictionary* ImplType; };
......@@ -97,6 +99,7 @@ template<> struct ImplTypeInfo<MutableDictionary*> { typedef WKMuta
template<> struct ImplTypeInfo<WebBackForwardList*> { typedef WKBackForwardListRef APIType; };
template<> struct ImplTypeInfo<WebBackForwardListItem*> { typedef WKBackForwardListItemRef APIType; };
template<> struct ImplTypeInfo<WebBoolean*> { typedef WKBooleanRef APIType; };
template<> struct ImplTypeInfo<WebCertificateInfo*> { typedef WKCertificateInfoRef APIType; };
template<> struct ImplTypeInfo<WebContext*> { typedef WKContextRef APIType; };
template<> struct ImplTypeInfo<WebData*> { typedef WKDataRef APIType; };
template<> struct ImplTypeInfo<WebDouble*> { typedef WKDoubleRef APIType; };
......
......@@ -44,6 +44,7 @@ typedef struct OpaqueWKDictionary* WKMutableDictionaryRef;
typedef const struct OpaqueWKBackForwardList* WKBackForwardListRef;
typedef const struct OpaqueWKBackForwardListItem* WKBackForwardListItemRef;
typedef const struct OpaqueWKBoolean* WKBooleanRef;
typedef const struct OpaqueWKCertificateInfo* WKCertificateInfoRef;
typedef const struct OpaqueWKContext* WKContextRef;
typedef const struct OpaqueWKData* WKDataRef;
typedef const struct OpaqueWKDouble* WKDoubleRef;
......
/*
* Copyright (C) 2010 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
* THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "WKCertificateInfo.h"
#include "WebCertificateInfo.h"
#include "WKAPICast.h"
using namespace WebKit;
WKTypeID WKCertificateInfoGetTypeID()
{
return toRef(WebCertificateInfo::APIType);
}
/*
* Copyright (C) 2010 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
* THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef WKCertificateInfo_h
#define WKCertificateInfo_h
#include <WebKit2/WKBase.h>
#ifdef __cplusplus
extern "C" {
#endif
WK_EXPORT WKTypeID WKCertificateInfoGetTypeID();
#ifdef __cplusplus
}
#endif
#endif /* WKCertificateInfo_h */
......@@ -70,3 +70,8 @@ WKPageRef WKFrameGetPage(WKFrameRef frameRef)
{
return toRef(toWK(frameRef)->page());
}
WKCertificateInfoRef WKFrameGetCertificateInfo(WKFrameRef frameRef)
{
return toRef(toWK(frameRef)->certificateInfo());
}
......@@ -52,6 +52,8 @@ WK_EXPORT WKURLRef WKFrameCopyURL(WKFrameRef frame);
WK_EXPORT WKPageRef WKFrameGetPage(WKFrameRef frame);
WK_EXPORT WKCertificateInfoRef WKFrameGetCertificateInfo(WKFrameRef frame);
#ifdef __cplusplus
}
#endif
......
/*
* Copyright (C) 2010 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
* THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef WKCertificateInfoMac_h
#define WKCertificateInfoMac_h
#include <Foundation/Foundation.h>
#include <WebKit2/WKBase.h>
#ifdef __cplusplus
extern "C" {
#endif
WK_EXPORT CFArrayRef WKCertificateInfoGetPeerCertificates(WKCertificateInfoRef certificateInfo);
#ifdef __cplusplus
}
#endif
#endif /* WKCertificateInfoMac_h */
/*
* Copyright (C) 2010 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
* THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "WKCertificateInfoMac.h"
#include "WKAPICast.h"
#include "WebCertificateInfo.h"
using namespace WebKit;
CFArrayRef WKCertificateInfoGetPeerCertificates(WKCertificateInfoRef certificateInfoRef)
{
return toWK(certificateInfoRef)->platformCertificateInfo().peerCertificates();
}
......@@ -25,6 +25,7 @@
#include "WebFrameProxy.h"
#include "WebCertificateInfo.h"
#include "WebFormSubmissionListenerProxy.h"
#include "WebFramePolicyListenerProxy.h"
#include "WebPageProxy.h"
......@@ -62,6 +63,11 @@ bool WebFrameProxy::isMainFrame() const
return this == m_page->mainFrame();
}
void WebFrameProxy::setCertificateInfo(PassRefPtr<WebCertificateInfo> certificateInfo)
{
m_certificateInfo = certificateInfo;
}
void WebFrameProxy::didStartProvisionalLoad(const String& url)
{
// FIXME: Add assertions.
......
......@@ -41,9 +41,11 @@ namespace CoreIPC {
namespace WebKit {
class WebPageProxy;
class WebFramePolicyListenerProxy;
class PlatformCertificateInfo;
class WebCertificateInfo;
class WebFormSubmissionListenerProxy;
class WebFramePolicyListenerProxy;
class WebPageProxy;
class WebFrameProxy : public APIObject {
public:
......@@ -72,6 +74,9 @@ public:
const WTF::String& url() const { return m_url; }