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

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

Issue 2689673002: Inline base::BinaryValue into base::Value (Closed)
Patch Set: Rebase Created 3 years, 10 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
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 <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
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 const base::BinaryValue* binary = 67 uint32_t size = static_cast<uint32_t>(value->GetSize());
68 static_cast<const base::BinaryValue*>(value); 68 const char* buffer = value->GetBuffer();
69 uint32_t size = static_cast<uint32_t>(binary->GetSize());
70 const char* buffer = binary->GetBuffer();
71 PP_Var array_buffer = 69 PP_Var array_buffer =
72 PpapiGlobals::Get()->GetVarTracker()->MakeArrayBufferPPVar(size, 70 PpapiGlobals::Get()->GetVarTracker()->MakeArrayBufferPPVar(size,
73 buffer); 71 buffer);
74 return array_buffer; 72 return array_buffer;
75 } 73 }
76 case base::Value::Type::DICTIONARY: 74 case base::Value::Type::DICTIONARY:
77 case base::Value::Type::LIST: 75 case base::Value::Type::LIST:
78 // Not handled. 76 // Not handled.
79 break; 77 break;
80 } 78 }
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
139 const std::vector<char>& der, 137 const std::vector<char>& der,
140 PPB_X509Certificate_Fields* result) { 138 PPB_X509Certificate_Fields* result) {
141 // A concrete PPB_X509Certificate_Private_Shared should only ever be 139 // A concrete PPB_X509Certificate_Private_Shared should only ever be
142 // 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
143 // already initialized. 141 // already initialized.
144 CHECK(false); 142 CHECK(false);
145 return false; 143 return false;
146 } 144 }
147 145
148 } // namespace ppapi 146 } // namespace ppapi
OLDNEW
« no previous file with comments | « media/base/video_frame_metadata.cc ('k') | tools/json_schema_compiler/test/error_generation_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698