1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "ppapi/cpp/private/x509_certificate_private.h"
7 #include "ppapi/cpp/module_impl.h"
8 #include "ppapi/cpp/pass_ref.h"
9 #include "ppapi/cpp/var.h"
15 template <> const char* interface_name
<PPB_X509Certificate_Private_0_1
>() {
16 return PPB_X509CERTIFICATE_PRIVATE_INTERFACE_0_1
;
21 X509CertificatePrivate::X509CertificatePrivate() : Resource() {}
23 X509CertificatePrivate::X509CertificatePrivate(PassRef
, PP_Resource resource
)
24 : Resource(PASS_REF
, resource
) {
27 X509CertificatePrivate::X509CertificatePrivate(const InstanceHandle
& instance
) {
28 if (has_interface
<PPB_X509Certificate_Private_0_1
>()) {
29 PassRefFromConstructor(get_interface
<PPB_X509Certificate_Private_0_1
>()->
30 Create(instance
.pp_instance()));
35 bool X509CertificatePrivate::IsAvailable() {
36 return has_interface
<PPB_X509Certificate_Private_0_1
>();
39 bool X509CertificatePrivate::Initialize(const char* bytes
, uint32_t length
) {
40 if (!has_interface
<PPB_X509Certificate_Private_0_1
>())
42 PP_Bool result
= get_interface
<PPB_X509Certificate_Private_0_1
>()->Initialize(
46 return PP_ToBool(result
);
49 Var
X509CertificatePrivate::GetField(
50 PP_X509Certificate_Private_Field field
) const {
51 if (!has_interface
<PPB_X509Certificate_Private_0_1
>())
54 get_interface
<PPB_X509Certificate_Private_0_1
>()->GetField(pp_resource(),