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

Unified Diff: ppapi/proxy/ppb_x509_certificate_private_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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ppapi/proxy/ppb_x509_certificate_private_proxy.h ('k') | ppapi/proxy/resource_creation_proxy.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/proxy/ppb_x509_certificate_private_proxy.cc
diff --git a/ppapi/proxy/ppb_x509_certificate_private_proxy.cc b/ppapi/proxy/ppb_x509_certificate_private_proxy.cc
new file mode 100644
index 0000000000000000000000000000000000000000..f673f3b1ecbf77f0e1927c22e96756e018ff2748
--- /dev/null
+++ b/ppapi/proxy/ppb_x509_certificate_private_proxy.cc
@@ -0,0 +1,75 @@
+// 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_x509_certificate_private_proxy.h"
+
+#include "ppapi/c/private/ppb_x509_certificate_private.h"
+#include "ppapi/proxy/plugin_globals.h"
+#include "ppapi/proxy/plugin_proxy_delegate.h"
+#include "ppapi/proxy/ppapi_messages.h"
+#include "ppapi/shared_impl/private/ppb_x509_certificate_private_shared.h"
+
+namespace ppapi {
+namespace proxy {
+
+namespace {
+
+class X509CertificatePrivate : public PPB_X509Certificate_Private_Shared {
+ public:
+ X509CertificatePrivate(PP_Instance instance);
+ virtual ~X509CertificatePrivate();
+
+ virtual bool ParseDER(const std::vector<char>& der,
+ PPB_X509Certificate_Fields* result) OVERRIDE;
+
+ private:
+ void SendToBrowser(IPC::Message* msg);
+
+ DISALLOW_COPY_AND_ASSIGN(X509CertificatePrivate);
+};
+
+X509CertificatePrivate::X509CertificatePrivate(PP_Instance instance)
+ : PPB_X509Certificate_Private_Shared(OBJECT_IS_PROXY, instance) {
+}
+
+X509CertificatePrivate::~X509CertificatePrivate() {
+}
+
+bool X509CertificatePrivate::ParseDER(const std::vector<char>& der,
+ PPB_X509Certificate_Fields* result) {
+ bool succeeded = false;
+ SendToBrowser(
+ new PpapiHostMsg_PPBX509Certificate_ParseDER(der, &succeeded, result));
+ return succeeded;
+}
+
+void X509CertificatePrivate::SendToBrowser(IPC::Message* msg) {
+ PluginGlobals::Get()->plugin_proxy_delegate()->SendToBrowser(msg);
+}
+
+} // namespace
+
+//------------------------------------------------------------------------------
+
+PPB_X509Certificate_Private_Proxy::PPB_X509Certificate_Private_Proxy(
+ Dispatcher* dispatcher)
+ : InterfaceProxy(dispatcher) {
+}
+
+PPB_X509Certificate_Private_Proxy::~PPB_X509Certificate_Private_Proxy() {
+}
+
+// static
+PP_Resource PPB_X509Certificate_Private_Proxy::CreateProxyResource(
+ PP_Instance instance) {
+ return (new X509CertificatePrivate(instance))->GetReference();
+}
+
+bool PPB_X509Certificate_Private_Proxy::OnMessageReceived(
+ const IPC::Message& msg) {
+ return false;
+}
+
+} // namespace proxy
+} // namespace ppapi
« no previous file with comments | « ppapi/proxy/ppb_x509_certificate_private_proxy.h ('k') | ppapi/proxy/resource_creation_proxy.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698