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" |
11 | 11 |
12 namespace ppapi { | 12 namespace ppapi { |
13 | 13 |
14 PPB_X509Certificate_Fields::PPB_X509Certificate_Fields() {} | 14 PPB_X509Certificate_Fields::PPB_X509Certificate_Fields() {} |
15 | 15 |
16 PPB_X509Certificate_Fields::PPB_X509Certificate_Fields( | 16 PPB_X509Certificate_Fields::PPB_X509Certificate_Fields( |
17 const PPB_X509Certificate_Fields& fields) { | 17 const PPB_X509Certificate_Fields& fields) { |
18 values_.Swap(fields.values_.DeepCopy()); | 18 scoped_ptr<ListValue> new_values(fields.values_.DeepCopy()); |
| 19 values_.Swap(new_values.get()); |
19 } | 20 } |
20 | 21 |
21 void PPB_X509Certificate_Fields::SetField( | 22 void PPB_X509Certificate_Fields::SetField( |
22 PP_X509Certificate_Private_Field field, | 23 PP_X509Certificate_Private_Field field, |
23 base::Value* value) { | 24 base::Value* value) { |
24 uint32_t index = static_cast<uint32_t>(field); | 25 uint32_t index = static_cast<uint32_t>(field); |
25 bool success = values_.Set(index, value); | 26 bool success = values_.Set(index, value); |
26 DCHECK(success); | 27 DCHECK(success); |
27 } | 28 } |
28 | 29 |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
136 const std::vector<char>& der, | 137 const std::vector<char>& der, |
137 PPB_X509Certificate_Fields* result) { | 138 PPB_X509Certificate_Fields* result) { |
138 // A concrete PPB_X509Certificate_Private_Shared should only ever be | 139 // A concrete PPB_X509Certificate_Private_Shared should only ever be |
139 // 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 |
140 // already initialized. | 141 // already initialized. |
141 CHECK(false); | 142 CHECK(false); |
142 return false; | 143 return false; |
143 } | 144 } |
144 | 145 |
145 } // namespace ppapi | 146 } // namespace ppapi |
OLD | NEW |