| OLD | NEW |
| (Empty) | |
| 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. |
| 4 |
| 5 #include "ppapi/cpp/private/flash_x509_certificate.h" |
| 6 |
| 7 #include <map> |
| 8 |
| 9 #include "ppapi/cpp/module_impl.h" |
| 10 |
| 11 namespace pp { |
| 12 |
| 13 namespace { |
| 14 |
| 15 template <> const char* interface_name<PPB_Flash_X509Certificate>() { |
| 16 return PPB_FLASH_X509CERTIFICATE_INTERFACE; |
| 17 } |
| 18 |
| 19 } // namespace |
| 20 |
| 21 X509Certificate::X509Certificate() : Resource() { |
| 22 } |
| 23 |
| 24 X509Certificate::X509Certificate(PP_Resource resource) : Resource(resource) { |
| 25 } |
| 26 |
| 27 X509Certificate::X509Certificate(const InstanceHandle& instance) { |
| 28 if (has_interface<PPB_Flash_X509Certificate>() && instance.pp_instance()) { |
| 29 PassRefFromConstructor(get_interface<PPB_Flash_X509Certificate>()->Create( |
| 30 instance.pp_instance())); |
| 31 } |
| 32 } |
| 33 |
| 34 // static |
| 35 bool X509Certificate::IsAvailable() { |
| 36 return has_interface<PPB_Flash_X509Certificate>(); |
| 37 } |
| 38 |
| 39 bool X509Certificate::Init(const char* bytes, |
| 40 uint32_t length) { |
| 41 if (!has_interface<PPB_Flash_X509Certificate>()) |
| 42 return false; |
| 43 return get_interface<PPB_Flash_X509Certificate>()->Init(pp_resource(), |
| 44 bytes, |
| 45 length); |
| 46 } |
| 47 |
| 48 Var X509Certificate::GetField(PP_Flash_X509Certificate_Field field) { |
| 49 if (!has_interface<PPB_Flash_X509Certificate>()) |
| 50 return Var(); |
| 51 return Var(PassRef(), |
| 52 get_interface<PPB_Flash_X509Certificate>()->GetField(pp_resource(), |
| 53 field)); |
| 54 } |
| 55 |
| 56 } // namespace pp |
| OLD | NEW |