Chromium Code Reviews| Index: ppapi/proxy/ppb_flash_x509_certificate_proxy.cc |
| diff --git a/ppapi/proxy/ppb_flash_x509_certificate_proxy.cc b/ppapi/proxy/ppb_flash_x509_certificate_proxy.cc |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..21d7ebb7f33733f51f1e3814efe9dc1124ff983f |
| --- /dev/null |
| +++ b/ppapi/proxy/ppb_flash_x509_certificate_proxy.cc |
| @@ -0,0 +1,76 @@ |
| +// 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/proxy/ppb_flash_x509_certificate_proxy.h" |
| + |
| +#include "ppapi/c/private/ppb_flash_x509_certificate.h" |
| +#include "ppapi/shared_impl/private/ppb_flash_x509_certificate_shared.h" |
|
yzshen1
2012/03/22 23:32:40
sort, please.
raymes
2012/03/26 16:05:57
Done.
|
| +#include "ppapi/proxy/plugin_globals.h" |
| +#include "ppapi/proxy/plugin_proxy_delegate.h" |
| +#include "ppapi/proxy/ppapi_messages.h" |
| + |
| +namespace ppapi { |
| +namespace proxy { |
| + |
| +namespace { |
| + |
| +class FlashX509Certificate : public PPB_Flash_X509Certificate_Shared { |
| + public: |
| + FlashX509Certificate(ResourceObjectType type, PP_Instance instance); |
|
yzshen1
2012/03/22 23:32:40
If OBJECT_IS_PROXY is the only value that you will
raymes
2012/03/26 16:05:57
Done.
|
| + virtual ~FlashX509Certificate(); |
| + |
| + virtual bool ParseDER(const std::vector<char>& der, |
| + PPB_X509Certificate_Fields* result) OVERRIDE; |
| + |
| + private: |
| + void SendToBrowser(IPC::Message* msg); |
| + |
| + DISALLOW_COPY_AND_ASSIGN(FlashX509Certificate); |
| +}; |
| + |
| +FlashX509Certificate::FlashX509Certificate(ResourceObjectType type, |
| + PP_Instance instance) |
| + : PPB_Flash_X509Certificate_Shared(type, instance) { |
| +} |
| + |
| +FlashX509Certificate::~FlashX509Certificate() { |
| +} |
| + |
| +bool FlashX509Certificate::ParseDER(const std::vector<char>& der, |
| + PPB_X509Certificate_Fields* result) { |
| + bool succeeded = false; |
| + SendToBrowser( |
| + new PpapiHostMsg_PPBX509Certificate_ParseDER(der, &succeeded, result)); |
| + return succeeded; |
| +} |
| + |
| +void FlashX509Certificate::SendToBrowser(IPC::Message* msg) { |
| + PluginGlobals::Get()->plugin_proxy_delegate()->SendToBrowser(msg); |
| +} |
| + |
| +} // namespace |
| + |
| +//------------------------------------------------------------------------------ |
| + |
| +PPB_Flash_X509Certificate_Proxy::PPB_Flash_X509Certificate_Proxy( |
| + Dispatcher* dispatcher) |
| + : InterfaceProxy(dispatcher) { |
| +} |
| + |
| +PPB_Flash_X509Certificate_Proxy::~PPB_Flash_X509Certificate_Proxy() { |
| +} |
| + |
| +// static |
| +PP_Resource PPB_Flash_X509Certificate_Proxy::CreateProxyResource( |
| + PP_Instance instance) { |
| + return (new FlashX509Certificate(OBJECT_IS_PROXY, instance))->GetReference(); |
| +} |
| + |
| +bool PPB_Flash_X509Certificate_Proxy::OnMessageReceived( |
| + const IPC::Message& msg) { |
| + return false; |
| +} |
| + |
| +} // namespace proxy |
| +} // namespace ppapi |