| 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 "chromeos/network/onc/onc_mapper.h" | 5 #include "chromeos/network/onc/onc_mapper.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/values.h" | 8 #include "base/values.h" |
| 9 #include "chromeos/network/onc/onc_signature.h" | 9 #include "chromeos/network/onc/onc_signature.h" |
| 10 | 10 |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 const base::Value& onc_primitive, | 60 const base::Value& onc_primitive, |
| 61 bool* error) { | 61 bool* error) { |
| 62 return make_scoped_ptr(onc_primitive.DeepCopy()); | 62 return make_scoped_ptr(onc_primitive.DeepCopy()); |
| 63 } | 63 } |
| 64 | 64 |
| 65 void Mapper::MapFields(const OncValueSignature& object_signature, | 65 void Mapper::MapFields(const OncValueSignature& object_signature, |
| 66 const base::DictionaryValue& onc_object, | 66 const base::DictionaryValue& onc_object, |
| 67 bool* found_unknown_field, | 67 bool* found_unknown_field, |
| 68 bool* nested_error, | 68 bool* nested_error, |
| 69 base::DictionaryValue* result) { | 69 base::DictionaryValue* result) { |
| 70 | |
| 71 for (base::DictionaryValue::Iterator it(onc_object); it.HasNext(); | 70 for (base::DictionaryValue::Iterator it(onc_object); it.HasNext(); |
| 72 it.Advance()) { | 71 it.Advance()) { |
| 73 bool current_field_unknown = false; | 72 bool current_field_unknown = false; |
| 74 scoped_ptr<base::Value> result_value = MapField(it.key(), | 73 scoped_ptr<base::Value> result_value = MapField(it.key(), |
| 75 object_signature, | 74 object_signature, |
| 76 it.value(), | 75 it.value(), |
| 77 ¤t_field_unknown, | 76 ¤t_field_unknown, |
| 78 nested_error); | 77 nested_error); |
| 79 | 78 |
| 80 if (current_field_unknown) | 79 if (current_field_unknown) |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 135 | 134 |
| 136 scoped_ptr<base::Value> Mapper::MapEntry(int index, | 135 scoped_ptr<base::Value> Mapper::MapEntry(int index, |
| 137 const OncValueSignature& signature, | 136 const OncValueSignature& signature, |
| 138 const base::Value& onc_value, | 137 const base::Value& onc_value, |
| 139 bool* error) { | 138 bool* error) { |
| 140 return MapValue(signature, onc_value, error); | 139 return MapValue(signature, onc_value, error); |
| 141 } | 140 } |
| 142 | 141 |
| 143 } // namespace onc | 142 } // namespace onc |
| 144 } // namespace chromeos | 143 } // namespace chromeos |
| OLD | NEW |