OLD | NEW |
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 <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "ppapi/shared_impl/ppapi_globals.h" | 10 #include "ppapi/shared_impl/ppapi_globals.h" |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
57 double val; | 57 double val; |
58 value->GetAsDouble(&val); | 58 value->GetAsDouble(&val); |
59 return PP_MakeDouble(val); | 59 return PP_MakeDouble(val); |
60 } | 60 } |
61 case base::Value::Type::STRING: { | 61 case base::Value::Type::STRING: { |
62 std::string val; | 62 std::string val; |
63 value->GetAsString(&val); | 63 value->GetAsString(&val); |
64 return StringVar::StringToPPVar(val); | 64 return StringVar::StringToPPVar(val); |
65 } | 65 } |
66 case base::Value::Type::BINARY: { | 66 case base::Value::Type::BINARY: { |
67 uint32_t size = static_cast<uint32_t>(value->GetSize()); | 67 uint32_t size = static_cast<uint32_t>(value->GetBlob().size()); |
68 const char* buffer = value->GetBuffer(); | 68 const char* buffer = value->GetBlob().data(); |
69 PP_Var array_buffer = | 69 PP_Var array_buffer = |
70 PpapiGlobals::Get()->GetVarTracker()->MakeArrayBufferPPVar(size, | 70 PpapiGlobals::Get()->GetVarTracker()->MakeArrayBufferPPVar(size, |
71 buffer); | 71 buffer); |
72 return array_buffer; | 72 return array_buffer; |
73 } | 73 } |
74 case base::Value::Type::DICTIONARY: | 74 case base::Value::Type::DICTIONARY: |
75 case base::Value::Type::LIST: | 75 case base::Value::Type::LIST: |
76 // Not handled. | 76 // Not handled. |
77 break; | 77 break; |
78 } | 78 } |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
137 const std::vector<char>& der, | 137 const std::vector<char>& der, |
138 PPB_X509Certificate_Fields* result) { | 138 PPB_X509Certificate_Fields* result) { |
139 // A concrete PPB_X509Certificate_Private_Shared should only ever be | 139 // A concrete PPB_X509Certificate_Private_Shared should only ever be |
140 // constructed by passing in PPB_X509Certificate_Fields, in which case it is | 140 // constructed by passing in PPB_X509Certificate_Fields, in which case it is |
141 // already initialized. | 141 // already initialized. |
142 CHECK(false); | 142 CHECK(false); |
143 return false; | 143 return false; |
144 } | 144 } |
145 | 145 |
146 } // namespace ppapi | 146 } // namespace ppapi |
OLD | NEW |