| 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/proxy/ppb_flash_x509_certificate_proxy.h" |
| 6 |
| 7 #include "ppapi/c/private/ppb_flash_x509_certificate.h" |
| 8 #include "ppapi/shared_impl/private/ppb_flash_x509_certificate_shared.h" |
| 9 #include "ppapi/proxy/plugin_globals.h" |
| 10 #include "ppapi/proxy/plugin_proxy_delegate.h" |
| 11 #include "ppapi/proxy/ppapi_messages.h" |
| 12 |
| 13 namespace ppapi { |
| 14 namespace proxy { |
| 15 |
| 16 namespace { |
| 17 |
| 18 class FlashX509Certificate : public PPB_Flash_X509Certificate_Shared { |
| 19 public: |
| 20 FlashX509Certificate(ResourceObjectType type, PP_Instance instance); |
| 21 virtual ~FlashX509Certificate(); |
| 22 |
| 23 virtual bool ParseDER(const std::vector<char>& der, |
| 24 PPB_X509Certificate_Fields* result) OVERRIDE; |
| 25 |
| 26 private: |
| 27 void SendToBrowser(IPC::Message* msg); |
| 28 |
| 29 DISALLOW_COPY_AND_ASSIGN(FlashX509Certificate); |
| 30 }; |
| 31 |
| 32 FlashX509Certificate::FlashX509Certificate(ResourceObjectType type, |
| 33 PP_Instance instance) |
| 34 : PPB_Flash_X509Certificate_Shared(type, instance) { |
| 35 } |
| 36 |
| 37 FlashX509Certificate::~FlashX509Certificate() { |
| 38 } |
| 39 |
| 40 bool FlashX509Certificate::ParseDER(const std::vector<char>& der, |
| 41 PPB_X509Certificate_Fields* result) { |
| 42 bool succeeded = false; |
| 43 SendToBrowser( |
| 44 new PpapiHostMsg_PPBX509Certificate_ParseDER(der, &succeeded, result)); |
| 45 return succeeded; |
| 46 } |
| 47 |
| 48 void FlashX509Certificate::SendToBrowser(IPC::Message* msg) { |
| 49 PluginGlobals::Get()->plugin_proxy_delegate()->SendToBrowser(msg); |
| 50 } |
| 51 |
| 52 } // namespace |
| 53 |
| 54 //------------------------------------------------------------------------------ |
| 55 |
| 56 PPB_Flash_X509Certificate_Proxy::PPB_Flash_X509Certificate_Proxy( |
| 57 Dispatcher* dispatcher) |
| 58 : InterfaceProxy(dispatcher) { |
| 59 } |
| 60 |
| 61 PPB_Flash_X509Certificate_Proxy::~PPB_Flash_X509Certificate_Proxy() { |
| 62 } |
| 63 |
| 64 // static |
| 65 PP_Resource PPB_Flash_X509Certificate_Proxy::CreateProxyResource( |
| 66 PP_Instance instance) { |
| 67 return (new FlashX509Certificate(OBJECT_IS_PROXY, instance))->GetReference(); |
| 68 } |
| 69 |
| 70 bool PPB_Flash_X509Certificate_Proxy::OnMessageReceived( |
| 71 const IPC::Message& msg) { |
| 72 return false; |
| 73 } |
| 74 |
| 75 } // namespace proxy |
| 76 } // namespace ppapi |
| OLD | NEW |