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

Side by Side Diff: ppapi/shared_impl/private/ppb_x509_certificate_private_shared.cc

Issue 9699100: Add functionality to pppapi TCPSocket to support secure sockets in flash (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 years, 8 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ppapi/shared_impl/private/ppb_x509_certificate_private_shared.h" 5 #include "ppapi/shared_impl/private/ppb_x509_certificate_private_shared.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "ppapi/shared_impl/ppapi_globals.h" 8 #include "ppapi/shared_impl/ppapi_globals.h"
9 #include "ppapi/shared_impl/var.h" 9 #include "ppapi/shared_impl/var.h"
10 #include "ppapi/shared_impl/var_tracker.h" 10 #include "ppapi/shared_impl/var_tracker.h"
11 11
12 namespace ppapi { 12 namespace ppapi {
13 13
14 PPB_X509Certificate_Fields::PPB_X509Certificate_Fields() {
Ryan Sleevi 2012/04/06 00:37:49 nit: Same line for empty ctors when they fit.
raymes 2012/04/06 23:22:47 Done.
15 }
16
17 PPB_X509Certificate_Fields::PPB_X509Certificate_Fields(
18 const PPB_X509Certificate_Fields& fields) {
19 for (size_t i = 0; i < fields.values_.GetSize(); ++i) {
yzshen1 2012/04/06 19:24:33 [nit, optional] Can you use virtual ListValue* Dee
raymes 2012/04/06 23:22:47 Done.
20 base::Value* value;
21 fields.values_.Get(i, &value);
22 values_.Append(value->DeepCopy());
23 }
24 }
25
14 void PPB_X509Certificate_Fields::SetField( 26 void PPB_X509Certificate_Fields::SetField(
15 PP_X509Certificate_Private_Field field, 27 PP_X509Certificate_Private_Field field,
16 base::Value* value) { 28 base::Value* value) {
17 uint32_t index = static_cast<uint32_t>(field); 29 uint32_t index = static_cast<uint32_t>(field);
18 bool success = values_.Set(index, value); 30 bool success = values_.Set(index, value);
19 DCHECK(success); 31 DCHECK(success);
20 } 32 }
21 33
22 PP_Var PPB_X509Certificate_Fields::GetFieldAsPPVar( 34 PP_Var PPB_X509Certificate_Fields::GetFieldAsPPVar(
23 PP_X509Certificate_Private_Field field) const { 35 PP_X509Certificate_Private_Field field) const {
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
77 //------------------------------------------------------------------------------ 89 //------------------------------------------------------------------------------
78 90
79 PPB_X509Certificate_Private_Shared::PPB_X509Certificate_Private_Shared( 91 PPB_X509Certificate_Private_Shared::PPB_X509Certificate_Private_Shared(
80 ResourceObjectType type, 92 ResourceObjectType type,
81 PP_Instance instance) : Resource(type, instance), fields_(NULL) { 93 PP_Instance instance) : Resource(type, instance), fields_(NULL) {
82 } 94 }
83 95
84 PPB_X509Certificate_Private_Shared::PPB_X509Certificate_Private_Shared( 96 PPB_X509Certificate_Private_Shared::PPB_X509Certificate_Private_Shared(
85 ResourceObjectType type, 97 ResourceObjectType type,
86 PP_Instance instance, 98 PP_Instance instance,
87 PPB_X509Certificate_Fields* fields) 99 const PPB_X509Certificate_Fields& fields)
88 : Resource(type, instance), 100 : Resource(type, instance),
yzshen1 2012/04/06 19:24:33 I think the convention is to *not* add 4 more spac
raymes 2012/04/06 23:22:47 Done.
89 fields_(fields) { 101 fields_(new PPB_X509Certificate_Fields(fields))
102 {
yzshen1 2012/04/06 19:24:33 And move it to the end of the previous line.
raymes 2012/04/06 23:22:47 Done.
90 } 103 }
91 104
92 PPB_X509Certificate_Private_Shared::~PPB_X509Certificate_Private_Shared() { 105 PPB_X509Certificate_Private_Shared::~PPB_X509Certificate_Private_Shared() {
93 } 106 }
94 107
95 thunk::PPB_X509Certificate_Private_API* 108 thunk::PPB_X509Certificate_Private_API*
96 PPB_X509Certificate_Private_Shared::AsPPB_X509Certificate_Private_API() { 109 PPB_X509Certificate_Private_Shared::AsPPB_X509Certificate_Private_API() {
97 return this; 110 return this;
98 } 111 }
99 112
(...skipping 29 matching lines...) Expand all
129 const std::vector<char>& der, 142 const std::vector<char>& der,
130 PPB_X509Certificate_Fields* result) { 143 PPB_X509Certificate_Fields* result) {
131 // A concrete PPB_X509Certificate_Private_Shared should only ever be 144 // A concrete PPB_X509Certificate_Private_Shared should only ever be
132 // constructed by passing in PPB_X509Certificate_Fields, in which case it is 145 // constructed by passing in PPB_X509Certificate_Fields, in which case it is
133 // already initialized. 146 // already initialized.
134 CHECK(false); 147 CHECK(false);
135 return false; 148 return false;
136 } 149 }
137 150
138 } // namespace ppapi 151 } // namespace ppapi
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698