#include "libcef_dll/cpptoc/sslinfo_cpptoc.h"
#include "libcef_dll/cpptoc/x509certificate_cpptoc.h"
#include "libcef_dll/shutdown_checker.h"
namespace {
cef_cert_status_t CEF_CALLBACK
sslinfo_get_cert_status(struct _cef_sslinfo_t* self) {
shutdown_checker::AssertNotShutdown();
DCHECK(self);
if (!self)
return CERT_STATUS_NONE;
cef_cert_status_t _retval = CefSSLInfoCppToC::Get(self)->GetCertStatus();
return _retval;
}
struct _cef_x509certificate_t* CEF_CALLBACK
sslinfo_get_x509certificate(struct _cef_sslinfo_t* self) {
shutdown_checker::AssertNotShutdown();
DCHECK(self);
if (!self)
return NULL;
CefRefPtr<CefX509Certificate> _retval =
CefSSLInfoCppToC::Get(self)->GetX509Certificate();
return CefX509CertificateCppToC::Wrap(_retval);
}
}
CefSSLInfoCppToC::CefSSLInfoCppToC() {
GetStruct()->get_cert_status = sslinfo_get_cert_status;
GetStruct()->get_x509certificate = sslinfo_get_x509certificate;
}
CefSSLInfoCppToC::~CefSSLInfoCppToC() {
shutdown_checker::AssertNotShutdown();
}
template <>
CefRefPtr<CefSSLInfo>
CefCppToCRefCounted<CefSSLInfoCppToC, CefSSLInfo, cef_sslinfo_t>::UnwrapDerived(
CefWrapperType type,
cef_sslinfo_t* s) {
NOTREACHED() << "Unexpected class type: " << type;
return nullptr;
}
template <>
CefWrapperType CefCppToCRefCounted<CefSSLInfoCppToC,
CefSSLInfo,
cef_sslinfo_t>::kWrapperType = WT_SSLINFO;