| Index: ppapi/cpp/private/flash_x509_certificate.cc
|
| diff --git a/ppapi/cpp/private/flash_x509_certificate.cc b/ppapi/cpp/private/flash_x509_certificate.cc
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..345836ca028521264b7063ee4ab3122f122f3182
|
| --- /dev/null
|
| +++ b/ppapi/cpp/private/flash_x509_certificate.cc
|
| @@ -0,0 +1,56 @@
|
| +// Copyright (c) 2012 The Chromium Authors. All rights reserved.
|
| +// Use of this source code is governed by a BSD-style license that can be
|
| +// found in the LICENSE file.
|
| +
|
| +#include "ppapi/cpp/private/flash_x509_certificate.h"
|
| +
|
| +#include <map>
|
| +
|
| +#include "ppapi/cpp/module_impl.h"
|
| +
|
| +namespace pp {
|
| +
|
| +namespace {
|
| +
|
| +template <> const char* interface_name<PPB_Flash_X509Certificate>() {
|
| + return PPB_FLASH_X509CERTIFICATE_INTERFACE;
|
| +}
|
| +
|
| +} // namespace
|
| +
|
| +X509Certificate::X509Certificate() : Resource() {
|
| +}
|
| +
|
| +X509Certificate::X509Certificate(PP_Resource resource) : Resource(resource) {
|
| +}
|
| +
|
| +X509Certificate::X509Certificate(const InstanceHandle& instance) {
|
| + if (has_interface<PPB_Flash_X509Certificate>() && instance.pp_instance()) {
|
| + PassRefFromConstructor(get_interface<PPB_Flash_X509Certificate>()->Create(
|
| + instance.pp_instance()));
|
| + }
|
| +}
|
| +
|
| +// static
|
| +bool X509Certificate::IsAvailable() {
|
| + return has_interface<PPB_Flash_X509Certificate>();
|
| +}
|
| +
|
| +bool X509Certificate::Init(const char* bytes,
|
| + uint32_t length) {
|
| + if (!has_interface<PPB_Flash_X509Certificate>())
|
| + return false;
|
| + return get_interface<PPB_Flash_X509Certificate>()->Init(pp_resource(),
|
| + bytes,
|
| + length);
|
| +}
|
| +
|
| +Var X509Certificate::GetField(PP_Flash_X509Certificate_Field field) {
|
| + if (!has_interface<PPB_Flash_X509Certificate>())
|
| + return Var();
|
| + return Var(PassRef(),
|
| + get_interface<PPB_Flash_X509Certificate>()->GetField(pp_resource(),
|
| + field));
|
| +}
|
| +
|
| +} // namespace pp
|
|
|