2016-01-08 20:00:27 +01:00
|
|
|
// Copyright (c) 2016 The Chromium Embedded Framework Authors. All rights
|
2015-02-11 19:15:04 +01:00
|
|
|
// reserved. Use of this source code is governed by a BSD-style license that
|
|
|
|
// can be found in the LICENSE file.
|
|
|
|
//
|
|
|
|
// ---------------------------------------------------------------------------
|
|
|
|
//
|
|
|
|
// This file was generated by the CEF translator tool. If making changes by
|
|
|
|
// hand only do so within the body of existing method and function
|
|
|
|
// implementations. See the translator.README.txt file in the tools directory
|
|
|
|
// for more information.
|
|
|
|
//
|
|
|
|
|
2015-12-18 19:03:03 +01:00
|
|
|
#include <algorithm>
|
2015-02-11 19:15:04 +01:00
|
|
|
#include "libcef_dll/ctocpp/binary_value_ctocpp.h"
|
|
|
|
#include "libcef_dll/ctocpp/sslcert_principal_ctocpp.h"
|
|
|
|
#include "libcef_dll/ctocpp/sslinfo_ctocpp.h"
|
|
|
|
|
|
|
|
|
|
|
|
// VIRTUAL METHODS - Body may be edited by hand.
|
|
|
|
|
2015-12-18 19:03:03 +01:00
|
|
|
cef_cert_status_t CefSSLInfoCToCpp::GetCertStatus() {
|
|
|
|
cef_sslinfo_t* _struct = GetStruct();
|
|
|
|
if (CEF_MEMBER_MISSING(_struct, get_cert_status))
|
|
|
|
return CERT_STATUS_NONE;
|
|
|
|
|
|
|
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
|
|
|
|
|
|
// Execute
|
|
|
|
cef_cert_status_t _retval = _struct->get_cert_status(_struct);
|
|
|
|
|
|
|
|
// Return type: simple
|
|
|
|
return _retval;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool CefSSLInfoCToCpp::IsCertStatusError() {
|
|
|
|
cef_sslinfo_t* _struct = GetStruct();
|
|
|
|
if (CEF_MEMBER_MISSING(_struct, is_cert_status_error))
|
|
|
|
return false;
|
|
|
|
|
|
|
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
|
|
|
|
|
|
// Execute
|
|
|
|
int _retval = _struct->is_cert_status_error(_struct);
|
|
|
|
|
|
|
|
// Return type: bool
|
|
|
|
return _retval?true:false;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool CefSSLInfoCToCpp::IsCertStatusMinorError() {
|
|
|
|
cef_sslinfo_t* _struct = GetStruct();
|
|
|
|
if (CEF_MEMBER_MISSING(_struct, is_cert_status_minor_error))
|
|
|
|
return false;
|
|
|
|
|
|
|
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
|
|
|
|
|
|
// Execute
|
|
|
|
int _retval = _struct->is_cert_status_minor_error(_struct);
|
|
|
|
|
|
|
|
// Return type: bool
|
|
|
|
return _retval?true:false;
|
|
|
|
}
|
|
|
|
|
2015-02-11 19:15:04 +01:00
|
|
|
CefRefPtr<CefSSLCertPrincipal> CefSSLInfoCToCpp::GetSubject() {
|
2015-04-26 20:40:01 +02:00
|
|
|
cef_sslinfo_t* _struct = GetStruct();
|
|
|
|
if (CEF_MEMBER_MISSING(_struct, get_subject))
|
2015-02-11 19:15:04 +01:00
|
|
|
return NULL;
|
|
|
|
|
|
|
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
|
|
|
|
|
|
// Execute
|
2015-04-26 20:40:01 +02:00
|
|
|
cef_sslcert_principal_t* _retval = _struct->get_subject(_struct);
|
2015-02-11 19:15:04 +01:00
|
|
|
|
|
|
|
// Return type: refptr_same
|
|
|
|
return CefSSLCertPrincipalCToCpp::Wrap(_retval);
|
|
|
|
}
|
|
|
|
|
|
|
|
CefRefPtr<CefSSLCertPrincipal> CefSSLInfoCToCpp::GetIssuer() {
|
2015-04-26 20:40:01 +02:00
|
|
|
cef_sslinfo_t* _struct = GetStruct();
|
|
|
|
if (CEF_MEMBER_MISSING(_struct, get_issuer))
|
2015-02-11 19:15:04 +01:00
|
|
|
return NULL;
|
|
|
|
|
|
|
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
|
|
|
|
|
|
// Execute
|
2015-04-26 20:40:01 +02:00
|
|
|
cef_sslcert_principal_t* _retval = _struct->get_issuer(_struct);
|
2015-02-11 19:15:04 +01:00
|
|
|
|
|
|
|
// Return type: refptr_same
|
|
|
|
return CefSSLCertPrincipalCToCpp::Wrap(_retval);
|
|
|
|
}
|
|
|
|
|
|
|
|
CefRefPtr<CefBinaryValue> CefSSLInfoCToCpp::GetSerialNumber() {
|
2015-04-26 20:40:01 +02:00
|
|
|
cef_sslinfo_t* _struct = GetStruct();
|
|
|
|
if (CEF_MEMBER_MISSING(_struct, get_serial_number))
|
2015-02-11 19:15:04 +01:00
|
|
|
return NULL;
|
|
|
|
|
|
|
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
|
|
|
|
|
|
// Execute
|
2015-04-26 20:40:01 +02:00
|
|
|
cef_binary_value_t* _retval = _struct->get_serial_number(_struct);
|
2015-02-11 19:15:04 +01:00
|
|
|
|
|
|
|
// Return type: refptr_same
|
|
|
|
return CefBinaryValueCToCpp::Wrap(_retval);
|
|
|
|
}
|
|
|
|
|
|
|
|
CefTime CefSSLInfoCToCpp::GetValidStart() {
|
2015-04-26 20:40:01 +02:00
|
|
|
cef_sslinfo_t* _struct = GetStruct();
|
|
|
|
if (CEF_MEMBER_MISSING(_struct, get_valid_start))
|
2015-02-11 19:15:04 +01:00
|
|
|
return CefTime();
|
|
|
|
|
|
|
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
|
|
|
|
|
|
// Execute
|
2015-04-26 20:40:01 +02:00
|
|
|
cef_time_t _retval = _struct->get_valid_start(_struct);
|
2015-02-11 19:15:04 +01:00
|
|
|
|
|
|
|
// Return type: simple
|
|
|
|
return _retval;
|
|
|
|
}
|
|
|
|
|
|
|
|
CefTime CefSSLInfoCToCpp::GetValidExpiry() {
|
2015-04-26 20:40:01 +02:00
|
|
|
cef_sslinfo_t* _struct = GetStruct();
|
|
|
|
if (CEF_MEMBER_MISSING(_struct, get_valid_expiry))
|
2015-02-11 19:15:04 +01:00
|
|
|
return CefTime();
|
|
|
|
|
|
|
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
|
|
|
|
|
|
// Execute
|
2015-04-26 20:40:01 +02:00
|
|
|
cef_time_t _retval = _struct->get_valid_expiry(_struct);
|
2015-02-11 19:15:04 +01:00
|
|
|
|
|
|
|
// Return type: simple
|
|
|
|
return _retval;
|
|
|
|
}
|
|
|
|
|
|
|
|
CefRefPtr<CefBinaryValue> CefSSLInfoCToCpp::GetDEREncoded() {
|
2015-04-26 20:40:01 +02:00
|
|
|
cef_sslinfo_t* _struct = GetStruct();
|
|
|
|
if (CEF_MEMBER_MISSING(_struct, get_derencoded))
|
2015-02-11 19:15:04 +01:00
|
|
|
return NULL;
|
|
|
|
|
|
|
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
|
|
|
|
|
|
// Execute
|
2015-04-26 20:40:01 +02:00
|
|
|
cef_binary_value_t* _retval = _struct->get_derencoded(_struct);
|
2015-02-11 19:15:04 +01:00
|
|
|
|
|
|
|
// Return type: refptr_same
|
|
|
|
return CefBinaryValueCToCpp::Wrap(_retval);
|
|
|
|
}
|
|
|
|
|
|
|
|
CefRefPtr<CefBinaryValue> CefSSLInfoCToCpp::GetPEMEncoded() {
|
2015-04-26 20:40:01 +02:00
|
|
|
cef_sslinfo_t* _struct = GetStruct();
|
|
|
|
if (CEF_MEMBER_MISSING(_struct, get_pemencoded))
|
2015-02-11 19:15:04 +01:00
|
|
|
return NULL;
|
|
|
|
|
|
|
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
|
|
|
|
|
|
// Execute
|
2015-04-26 20:40:01 +02:00
|
|
|
cef_binary_value_t* _retval = _struct->get_pemencoded(_struct);
|
2015-02-11 19:15:04 +01:00
|
|
|
|
|
|
|
// Return type: refptr_same
|
|
|
|
return CefBinaryValueCToCpp::Wrap(_retval);
|
|
|
|
}
|
|
|
|
|
2015-12-18 19:03:03 +01:00
|
|
|
size_t CefSSLInfoCToCpp::GetIssuerChainSize() {
|
|
|
|
cef_sslinfo_t* _struct = GetStruct();
|
|
|
|
if (CEF_MEMBER_MISSING(_struct, get_issuer_chain_size))
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
|
|
|
|
|
|
// Execute
|
|
|
|
size_t _retval = _struct->get_issuer_chain_size(_struct);
|
|
|
|
|
|
|
|
// Return type: simple
|
|
|
|
return _retval;
|
|
|
|
}
|
|
|
|
|
|
|
|
void CefSSLInfoCToCpp::GetDEREncodedIssuerChain(IssuerChainBinaryList& chain) {
|
|
|
|
cef_sslinfo_t* _struct = GetStruct();
|
|
|
|
if (CEF_MEMBER_MISSING(_struct, get_derencoded_issuer_chain))
|
|
|
|
return;
|
|
|
|
|
|
|
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
|
|
|
|
|
|
// Translate param: chain; type: refptr_vec_same_byref
|
|
|
|
size_t chainSize = chain.size();
|
|
|
|
size_t chainCount = std::max(GetIssuerChainSize(), chainSize);
|
|
|
|
cef_binary_value_t** chainList = NULL;
|
|
|
|
if (chainCount > 0) {
|
|
|
|
chainList = new cef_binary_value_t*[chainCount];
|
|
|
|
DCHECK(chainList);
|
|
|
|
if (chainList) {
|
|
|
|
memset(chainList, 0, sizeof(cef_binary_value_t*)*chainCount);
|
|
|
|
}
|
|
|
|
if (chainList && chainSize > 0) {
|
|
|
|
for (size_t i = 0; i < chainSize; ++i) {
|
|
|
|
chainList[i] = CefBinaryValueCToCpp::Unwrap(chain[i]);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// Execute
|
|
|
|
_struct->get_derencoded_issuer_chain(_struct,
|
|
|
|
&chainCount,
|
|
|
|
chainList);
|
|
|
|
|
|
|
|
// Restore param:chain; type: refptr_vec_same_byref
|
|
|
|
chain.clear();
|
|
|
|
if (chainCount > 0 && chainList) {
|
|
|
|
for (size_t i = 0; i < chainCount; ++i) {
|
|
|
|
chain.push_back(CefBinaryValueCToCpp::Wrap(chainList[i]));
|
|
|
|
}
|
|
|
|
delete [] chainList;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void CefSSLInfoCToCpp::GetPEMEncodedIssuerChain(IssuerChainBinaryList& chain) {
|
|
|
|
cef_sslinfo_t* _struct = GetStruct();
|
|
|
|
if (CEF_MEMBER_MISSING(_struct, get_pemencoded_issuer_chain))
|
|
|
|
return;
|
|
|
|
|
|
|
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
|
|
|
|
|
|
// Translate param: chain; type: refptr_vec_same_byref
|
|
|
|
size_t chainSize = chain.size();
|
|
|
|
size_t chainCount = std::max(GetIssuerChainSize(), chainSize);
|
|
|
|
cef_binary_value_t** chainList = NULL;
|
|
|
|
if (chainCount > 0) {
|
|
|
|
chainList = new cef_binary_value_t*[chainCount];
|
|
|
|
DCHECK(chainList);
|
|
|
|
if (chainList) {
|
|
|
|
memset(chainList, 0, sizeof(cef_binary_value_t*)*chainCount);
|
|
|
|
}
|
|
|
|
if (chainList && chainSize > 0) {
|
|
|
|
for (size_t i = 0; i < chainSize; ++i) {
|
|
|
|
chainList[i] = CefBinaryValueCToCpp::Unwrap(chain[i]);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// Execute
|
|
|
|
_struct->get_pemencoded_issuer_chain(_struct,
|
|
|
|
&chainCount,
|
|
|
|
chainList);
|
|
|
|
|
|
|
|
// Restore param:chain; type: refptr_vec_same_byref
|
|
|
|
chain.clear();
|
|
|
|
if (chainCount > 0 && chainList) {
|
|
|
|
for (size_t i = 0; i < chainCount; ++i) {
|
|
|
|
chain.push_back(CefBinaryValueCToCpp::Wrap(chainList[i]));
|
|
|
|
}
|
|
|
|
delete [] chainList;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-02-11 19:15:04 +01:00
|
|
|
|
2015-04-26 20:40:01 +02:00
|
|
|
// CONSTRUCTOR - Do not edit by hand.
|
|
|
|
|
|
|
|
CefSSLInfoCToCpp::CefSSLInfoCToCpp() {
|
|
|
|
}
|
|
|
|
|
|
|
|
template<> cef_sslinfo_t* CefCToCpp<CefSSLInfoCToCpp, CefSSLInfo,
|
|
|
|
cef_sslinfo_t>::UnwrapDerived(CefWrapperType type, CefSSLInfo* c) {
|
|
|
|
NOTREACHED() << "Unexpected class type: " << type;
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2015-02-11 19:15:04 +01:00
|
|
|
#ifndef NDEBUG
|
|
|
|
template<> base::AtomicRefCount CefCToCpp<CefSSLInfoCToCpp, CefSSLInfo,
|
|
|
|
cef_sslinfo_t>::DebugObjCt = 0;
|
|
|
|
#endif
|
|
|
|
|
2015-04-26 20:40:01 +02:00
|
|
|
template<> CefWrapperType CefCToCpp<CefSSLInfoCToCpp, CefSSLInfo,
|
|
|
|
cef_sslinfo_t>::kWrapperType = WT_SSLINFO;
|