| 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 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 86 } | 86 } |
| 87 } | 87 } |
| 88 | 88 |
| 89 scoped_ptr<base::Value> Mapper::MapField( | 89 scoped_ptr<base::Value> Mapper::MapField( |
| 90 const std::string& field_name, | 90 const std::string& field_name, |
| 91 const OncValueSignature& object_signature, | 91 const OncValueSignature& object_signature, |
| 92 const base::Value& onc_value, | 92 const base::Value& onc_value, |
| 93 bool* found_unknown_field, | 93 bool* found_unknown_field, |
| 94 bool* error) { | 94 bool* error) { |
| 95 const OncFieldSignature* field_signature = | 95 const OncFieldSignature* field_signature = |
| 96 GetFieldSignature(object_signature, field_name); | 96 GetOncFieldSignature(object_signature, field_name); |
| 97 | 97 |
| 98 if (field_signature != NULL) { | 98 if (field_signature != NULL) { |
| 99 DCHECK(field_signature->value_signature != NULL) | 99 DCHECK(field_signature->value_signature != NULL) |
| 100 << "Found missing value signature at field '" << field_name << "'."; | 100 << "Found missing value signature at field '" << field_name << "'."; |
| 101 | 101 |
| 102 return MapValue(*field_signature->value_signature, onc_value, error); | 102 return MapValue(*field_signature->value_signature, onc_value, error); |
| 103 } else { | 103 } else { |
| 104 DVLOG(1) << "Found unknown field name: '" << field_name << "'"; | 104 DVLOG(1) << "Found unknown field name: '" << field_name << "'"; |
| 105 *found_unknown_field = true; | 105 *found_unknown_field = true; |
| 106 return scoped_ptr<base::Value>(); | 106 return scoped_ptr<base::Value>(); |
| (...skipping 28 matching lines...) Expand all Loading... |
| 135 | 135 |
| 136 scoped_ptr<base::Value> Mapper::MapEntry(int index, | 136 scoped_ptr<base::Value> Mapper::MapEntry(int index, |
| 137 const OncValueSignature& signature, | 137 const OncValueSignature& signature, |
| 138 const base::Value& onc_value, | 138 const base::Value& onc_value, |
| 139 bool* error) { | 139 bool* error) { |
| 140 return MapValue(signature, onc_value, error); | 140 return MapValue(signature, onc_value, error); |
| 141 } | 141 } |
| 142 | 142 |
| 143 } // namespace onc | 143 } // namespace onc |
| 144 } // namespace chromeos | 144 } // namespace chromeos |
| OLD | NEW |