| 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 "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" |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 PP_X509Certificate_Private_Field field, | 23 PP_X509Certificate_Private_Field field, |
| 24 base::Value* value) { | 24 base::Value* value) { |
| 25 uint32_t index = static_cast<uint32_t>(field); | 25 uint32_t index = static_cast<uint32_t>(field); |
| 26 bool success = values_.Set(index, value); | 26 bool success = values_.Set(index, value); |
| 27 DCHECK(success); | 27 DCHECK(success); |
| 28 } | 28 } |
| 29 | 29 |
| 30 PP_Var PPB_X509Certificate_Fields::GetFieldAsPPVar( | 30 PP_Var PPB_X509Certificate_Fields::GetFieldAsPPVar( |
| 31 PP_X509Certificate_Private_Field field) const { | 31 PP_X509Certificate_Private_Field field) const { |
| 32 uint32_t index = static_cast<uint32_t>(field); | 32 uint32_t index = static_cast<uint32_t>(field); |
| 33 base::Value* value; | 33 const base::Value* value; |
| 34 bool success = values_.Get(index, &value); | 34 bool success = values_.Get(index, &value); |
| 35 if (!success) { | 35 if (!success) { |
| 36 // Our list received might be smaller than the number of fields, so just | 36 // Our list received might be smaller than the number of fields, so just |
| 37 // return null if the index is OOB. | 37 // return null if the index is OOB. |
| 38 return PP_MakeNull(); | 38 return PP_MakeNull(); |
| 39 } | 39 } |
| 40 | 40 |
| 41 switch (value->GetType()) { | 41 switch (value->GetType()) { |
| 42 case Value::TYPE_NULL: | 42 case Value::TYPE_NULL: |
| 43 return PP_MakeNull(); | 43 return PP_MakeNull(); |
| (...skipping 93 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 |