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

Unified Diff: ppapi/shared_impl/private/ppb_x509_certificate_private_shared.h

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/shared_impl/api_id.h ('k') | ppapi/shared_impl/private/ppb_x509_certificate_private_shared.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/shared_impl/private/ppb_x509_certificate_private_shared.h
diff --git a/ppapi/shared_impl/private/ppb_x509_certificate_private_shared.h b/ppapi/shared_impl/private/ppb_x509_certificate_private_shared.h
new file mode 100644
index 0000000000000000000000000000000000000000..70f84cd1c4321165d32e8d0947f99708bda4936a
--- /dev/null
+++ b/ppapi/shared_impl/private/ppb_x509_certificate_private_shared.h
@@ -0,0 +1,71 @@
+// 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.
+
+#ifndef PPAPI_SHARED_IMPL_PRIVATE_PPB_X509_CERTIFICATE_PRIVATE_IMPL_H_
+#define PPAPI_SHARED_IMPL_PRIVATE_PPB_X509_CERTIFICATE_PRIVATE_IMPL_H_
+
+#include <vector>
+
+#include "base/memory/scoped_ptr.h"
+#include "base/values.h"
+#include "ppapi/c/private/ppb_x509_certificate_private.h"
+#include "ppapi/shared_impl/resource.h"
+#include "ppapi/thunk/ppb_x509_certificate_private_api.h"
+
+namespace IPC {
+template <class T>
+struct ParamTraits;
+}
+
+namespace ppapi {
+
+class PPAPI_SHARED_EXPORT PPB_X509Certificate_Fields {
+ public:
+ // Takes ownership of |value|.
+ void SetField(PP_X509Certificate_Private_Field field, base::Value* value);
+ PP_Var GetFieldAsPPVar(PP_X509Certificate_Private_Field field) const;
+
+ private:
+ // Friend so ParamTraits can serialize us.
+ friend struct IPC::ParamTraits<ppapi::PPB_X509Certificate_Fields>;
+
+ base::ListValue values_;
+};
+
+//------------------------------------------------------------------------------
+
+class PPAPI_SHARED_EXPORT PPB_X509Certificate_Private_Shared
+ : public thunk::PPB_X509Certificate_Private_API,
+ public Resource {
+ public:
+ PPB_X509Certificate_Private_Shared(ResourceObjectType type,
+ PP_Instance instance);
+ // Used by tcp_socket_shared_impl to construct a certificate resource from a
+ // server certificate. This object owns the pointer passed in.
+ PPB_X509Certificate_Private_Shared(ResourceObjectType type,
+ PP_Instance instance,
+ PPB_X509Certificate_Fields* fields);
+ virtual ~PPB_X509Certificate_Private_Shared();
+
+ // Resource overrides.
+ virtual PPB_X509Certificate_Private_API*
+ AsPPB_X509Certificate_Private_API() OVERRIDE;
+
+ // PPB_X509Certificate_Private_API implementation.
+ virtual PP_Bool Initialize(const char* bytes, uint32_t length) OVERRIDE;
+ virtual PP_Var GetField(PP_X509Certificate_Private_Field field) OVERRIDE;
+
+ protected:
+ virtual bool ParseDER(const std::vector<char>& der,
+ PPB_X509Certificate_Fields* result);
+
+ private:
+ scoped_ptr<PPB_X509Certificate_Fields> fields_;
+
+ DISALLOW_COPY_AND_ASSIGN(PPB_X509Certificate_Private_Shared);
+};
+
+} // namespace ppapi
+
+#endif // PPAPI_SHARED_IMPL_PRIVATE_X509_CERTIFICATE_PRIVATE_IMPL_H_
« no previous file with comments | « ppapi/shared_impl/api_id.h ('k') | ppapi/shared_impl/private/ppb_x509_certificate_private_shared.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698