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

Unified Diff: ppapi/cpp/private/flash_x509_certificate.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/cpp/private/flash_x509_certificate.h ('k') | ppapi/ppapi_proxy.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/cpp/private/flash_x509_certificate.cc
diff --git a/ppapi/cpp/private/flash_x509_certificate.cc b/ppapi/cpp/private/flash_x509_certificate.cc
new file mode 100644
index 0000000000000000000000000000000000000000..345836ca028521264b7063ee4ab3122f122f3182
--- /dev/null
+++ b/ppapi/cpp/private/flash_x509_certificate.cc
@@ -0,0 +1,56 @@
+// 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/cpp/private/flash_x509_certificate.h"
+
+#include <map>
+
+#include "ppapi/cpp/module_impl.h"
+
+namespace pp {
+
+namespace {
+
+template <> const char* interface_name<PPB_Flash_X509Certificate>() {
+ return PPB_FLASH_X509CERTIFICATE_INTERFACE;
+}
+
+} // namespace
+
+X509Certificate::X509Certificate() : Resource() {
+}
+
+X509Certificate::X509Certificate(PP_Resource resource) : Resource(resource) {
+}
+
+X509Certificate::X509Certificate(const InstanceHandle& instance) {
+ if (has_interface<PPB_Flash_X509Certificate>() && instance.pp_instance()) {
+ PassRefFromConstructor(get_interface<PPB_Flash_X509Certificate>()->Create(
+ instance.pp_instance()));
+ }
+}
+
+// static
+bool X509Certificate::IsAvailable() {
+ return has_interface<PPB_Flash_X509Certificate>();
+}
+
+bool X509Certificate::Init(const char* bytes,
+ uint32_t length) {
+ if (!has_interface<PPB_Flash_X509Certificate>())
+ return false;
+ return get_interface<PPB_Flash_X509Certificate>()->Init(pp_resource(),
+ bytes,
+ length);
+}
+
+Var X509Certificate::GetField(PP_Flash_X509Certificate_Field field) {
+ if (!has_interface<PPB_Flash_X509Certificate>())
+ return Var();
+ return Var(PassRef(),
+ get_interface<PPB_Flash_X509Certificate>()->GetField(pp_resource(),
+ field));
+}
+
+} // namespace pp
« no previous file with comments | « ppapi/cpp/private/flash_x509_certificate.h ('k') | ppapi/ppapi_proxy.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698