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

Unified Diff: ppapi/proxy/ppb_flash_x509_certificate_proxy.cc

Issue 9405038: Add PPAPI interface for secure sockets in flash (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_flash_x509_certificate_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_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..377912eaa1d794f4c474a90d03b6887bb6b9efaf
--- /dev/null
+++ b/ppapi/proxy/ppb_flash_x509_certificate_proxy.cc
@@ -0,0 +1,79 @@
+// 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/pp_errors.h"
+#include "ppapi/c/private/ppb_flash_x509_certificate.h"
+#include "ppapi/shared_impl/private/ppb_flash_x509_certificate_shared.h"
+#include "ppapi/proxy/plugin_globals.h"
+#include "ppapi/proxy/plugin_proxy_delegate.h"
+#include "ppapi/proxy/ppapi_messages.h"
+#include "ppapi/proxy/serialized_var.h"
+#include "ppapi/thunk/enter.h"
+
+namespace ppapi {
+namespace proxy {
+
+namespace {
+
+class FlashX509Certificate : public PPB_Flash_X509Certificate_Shared {
+ public:
+ FlashX509Certificate(ResourceObjectType type, PP_Instance instance);
+ 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
« no previous file with comments | « ppapi/proxy/ppb_flash_x509_certificate_proxy.h ('k') | ppapi/proxy/resource_creation_proxy.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698