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