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

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

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/shared_impl/api_id.h ('k') | ppapi/shared_impl/private/ppb_flash_x509_certificate_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_flash_x509_certificate_shared.h
diff --git a/ppapi/shared_impl/private/ppb_flash_x509_certificate_shared.h b/ppapi/shared_impl/private/ppb_flash_x509_certificate_shared.h
new file mode 100644
index 0000000000000000000000000000000000000000..88a11aee8ef17540c02985742e219ce929e14384
--- /dev/null
+++ b/ppapi/shared_impl/private/ppb_flash_x509_certificate_shared.h
@@ -0,0 +1,82 @@
+// Copyright (c) 2011 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_FLASH_X509_CERTIFICATE_IMPL_H_
+#define PPAPI_SHARED_IMPL_PRIVATE_FLASH_X509_CERTIFICATE_IMPL_H_
+
+#include <vector>
+
+#include "base/memory/scoped_ptr.h"
+#include "ppapi/c/private/ppb_flash_x509_certificate.h"
+#include "ppapi/shared_impl/resource.h"
+#include "ppapi/shared_impl/tracked_callback.h"
+#include "ppapi/thunk/ppb_flash_x509_certificate_api.h"
+
+namespace IPC {
+class Message;
+}
+
+namespace ppapi {
+namespace proxy {
+class Dispatcher;
+}
+}
+
+namespace pp {
+class Var;
+}
+
+namespace ppapi {
+
+class PPB_X509Certificate_Fields {
+ public:
+ PPB_X509Certificate_Fields();
+ virtual ~PPB_X509Certificate_Fields();
+ pp::Var& operator[](const PP_Flash_X509Certificate_Field field);
+
+ // Implementation for IPC::ParamTraits<SerializedVar>.
+ void WriteToMessage(IPC::Message* m) const;
+ bool ReadFromMessage(const IPC::Message* m, void** iter);
+
+ private:
+ std::vector<pp::Var> data_;
+
+};
+
+class PPAPI_SHARED_EXPORT PPB_Flash_X509Certificate_Shared
+ : public thunk::PPB_Flash_X509Certificate_API,
+ public Resource {
+ public:
+ PPB_Flash_X509Certificate_Shared(ResourceObjectType type,
+ PP_Instance instance);
+ // Used by tcp socket shared impl to construct a certificate
+ // resource from a server certificate.
+ PPB_Flash_X509Certificate_Shared(ResourceObjectType type,
+ PP_Instance instance,
+ const PPB_X509Certificate_Fields& fields);
+ virtual ~PPB_Flash_X509Certificate_Shared();
+
+ // Resource overrides.
+ virtual PPB_Flash_X509Certificate_API*
+ AsPPB_Flash_X509Certificate_API() OVERRIDE;
+
+ // PPB_Flash_X509Certificate_API implementation.
+ virtual PP_Bool Init(const char* bytes,
+ uint32_t length) OVERRIDE;
+ virtual PP_Var GetField(PP_Flash_X509Certificate_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_Flash_X509Certificate_Shared);
+};
+
+} // namespace ppapi
+
+#endif // PPAPI_SHARED_IMPL_PRIVATE_FLASH_X509_CERTIFICATE_IMPL_H_
« no previous file with comments | « ppapi/shared_impl/api_id.h ('k') | ppapi/shared_impl/private/ppb_flash_x509_certificate_shared.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698