| 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 <string> | 5 #include <string> |
| 6 #include <utility> | 6 #include <utility> |
| 7 | 7 |
| 8 #include "base/json/json_reader.h" | 8 #include "base/json/json_reader.h" |
| 9 #include "base/json/json_writer.h" | 9 #include "base/json/json_writer.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 665 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 676 LOG(ERROR) << "ONC Field name: '" << onc_field_name << "' has type '" | 676 LOG(ERROR) << "ONC Field name: '" << onc_field_name << "' has type '" |
| 677 << field_signature->value_signature->onc_type | 677 << field_signature->value_signature->onc_type |
| 678 << "', expected: base::Value::Type::LIST: " << GetName(); | 678 << "', expected: base::Value::Type::LIST: " << GetName(); |
| 679 return; | 679 return; |
| 680 } | 680 } |
| 681 DCHECK(field_signature->value_signature->onc_array_entry_signature); | 681 DCHECK(field_signature->value_signature->onc_array_entry_signature); |
| 682 std::unique_ptr<base::ListValue> result(new base::ListValue()); | 682 std::unique_ptr<base::ListValue> result(new base::ListValue()); |
| 683 for (base::ListValue::const_iterator it = list.begin(); it != list.end(); | 683 for (base::ListValue::const_iterator it = list.begin(); it != list.end(); |
| 684 ++it) { | 684 ++it) { |
| 685 const base::DictionaryValue* shill_value = NULL; | 685 const base::DictionaryValue* shill_value = NULL; |
| 686 if (!it->GetAsDictionary(&shill_value)) | 686 if (!(*it)->GetAsDictionary(&shill_value)) |
| 687 continue; | 687 continue; |
| 688 ShillToONCTranslator nested_translator( | 688 ShillToONCTranslator nested_translator( |
| 689 *shill_value, onc_source_, | 689 *shill_value, onc_source_, |
| 690 *field_signature->value_signature->onc_array_entry_signature, | 690 *field_signature->value_signature->onc_array_entry_signature, |
| 691 network_state_); | 691 network_state_); |
| 692 std::unique_ptr<base::DictionaryValue> nested_object = | 692 std::unique_ptr<base::DictionaryValue> nested_object = |
| 693 nested_translator.CreateTranslatedONCObject(); | 693 nested_translator.CreateTranslatedONCObject(); |
| 694 // If the nested object couldn't be parsed, simply omit it. | 694 // If the nested object couldn't be parsed, simply omit it. |
| 695 if (nested_object->empty()) | 695 if (nested_object->empty()) |
| 696 continue; | 696 continue; |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 778 const NetworkState* network_state) { | 778 const NetworkState* network_state) { |
| 779 CHECK(onc_signature != NULL); | 779 CHECK(onc_signature != NULL); |
| 780 | 780 |
| 781 ShillToONCTranslator translator(shill_dictionary, onc_source, *onc_signature, | 781 ShillToONCTranslator translator(shill_dictionary, onc_source, *onc_signature, |
| 782 network_state); | 782 network_state); |
| 783 return translator.CreateTranslatedONCObject(); | 783 return translator.CreateTranslatedONCObject(); |
| 784 } | 784 } |
| 785 | 785 |
| 786 } // namespace onc | 786 } // namespace onc |
| 787 } // namespace chromeos | 787 } // namespace chromeos |
| OLD | NEW |