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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « ppapi/cpp/private/flash_x509_certificate.h ('k') | ppapi/ppapi_proxy.gypi » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "ppapi/cpp/private/flash_x509_certificate.h"
6
7 #include <map>
8
9 #include "ppapi/cpp/module_impl.h"
10
11 namespace pp {
12
13 namespace {
14
15 template <> const char* interface_name<PPB_Flash_X509Certificate>() {
16 return PPB_FLASH_X509CERTIFICATE_INTERFACE;
17 }
18
19 } // namespace
20
21 X509Certificate::X509Certificate() : Resource() {
22 }
23
24 X509Certificate::X509Certificate(PP_Resource resource) : Resource(resource) {
25 }
26
27 X509Certificate::X509Certificate(const InstanceHandle& instance) {
28 if (has_interface<PPB_Flash_X509Certificate>() && instance.pp_instance()) {
29 PassRefFromConstructor(get_interface<PPB_Flash_X509Certificate>()->Create(
30 instance.pp_instance()));
31 }
32 }
33
34 // static
35 bool X509Certificate::IsAvailable() {
36 return has_interface<PPB_Flash_X509Certificate>();
37 }
38
39 bool X509Certificate::Init(const char* bytes,
40 uint32_t length) {
41 if (!has_interface<PPB_Flash_X509Certificate>())
42 return false;
43 return get_interface<PPB_Flash_X509Certificate>()->Init(pp_resource(),
44 bytes,
45 length);
46 }
47
48 Var X509Certificate::GetField(PP_Flash_X509Certificate_Field field) {
49 if (!has_interface<PPB_Flash_X509Certificate>())
50 return Var();
51 return Var(PassRef(),
52 get_interface<PPB_Flash_X509Certificate>()->GetField(pp_resource(),
53 field));
54 }
55
56 } // namespace pp
OLDNEW
« 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