Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(28)

Side by Side Diff: ppapi/proxy/ppb_flash_x509_certificate_proxy.cc

Issue 9693024: Add the PPAPI X509 Certificate interface and implementation. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(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"
yzshen1 2012/03/22 23:32:40 sort, please.
raymes 2012/03/26 16:05:57 Done.
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);
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.
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698