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

Unified Diff: ppapi/cpp/private/x509_certificate_private.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/cpp/private/x509_certificate_private.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/x509_certificate_private.cc
diff --git a/ppapi/cpp/private/x509_certificate_private.cc b/ppapi/cpp/private/x509_certificate_private.cc
new file mode 100644
index 0000000000000000000000000000000000000000..c23481c5a6f82c71a984da136f08f7ac6070b4fc
--- /dev/null
+++ b/ppapi/cpp/private/x509_certificate_private.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/x509_certificate_private.h"
+
+#include "ppapi/cpp/module_impl.h"
+#include "ppapi/cpp/var.h"
+
+namespace pp {
+
+namespace {
+
+template <> const char* interface_name<PPB_X509Certificate_Private_0_1>() {
+ return PPB_X509CERTIFICATE_PRIVATE_INTERFACE_0_1;
+}
+
+} // namespace
+
+X509Certificate::X509Certificate() : Resource() {
+}
+
+X509Certificate::X509Certificate(PP_Resource resource) : Resource(resource) {
+}
+
+X509Certificate::X509Certificate(const InstanceHandle& instance) {
+ if (has_interface<PPB_X509Certificate_Private_0_1>()) {
+ PassRefFromConstructor(get_interface<PPB_X509Certificate_Private_0_1>()->
+ Create(instance.pp_instance()));
+ }
+}
+
+// static
+bool X509Certificate::IsAvailable() {
+ return has_interface<PPB_X509Certificate_Private_0_1>();
+}
+
+bool X509Certificate::Initialize(const char* bytes, uint32_t length) {
+ if (!has_interface<PPB_X509Certificate_Private_0_1>())
+ return false;
+ PP_Bool result = get_interface<PPB_X509Certificate_Private_0_1>()->Initialize(
+ pp_resource(),
+ bytes,
+ length);
+ return PP_ToBool(result);
+}
+
+Var X509Certificate::GetField(PP_X509Certificate_Private_Field field) const {
+ if (!has_interface<PPB_X509Certificate_Private_0_1>())
+ return Var();
+ return Var(PassRef(),
+ get_interface<PPB_X509Certificate_Private_0_1>()->GetField(pp_resource(),
+ field));
+}
+
+} // namespace pp
« no previous file with comments | « ppapi/cpp/private/x509_certificate_private.h ('k') | ppapi/ppapi_proxy.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698