| 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 676 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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; |
| 697 result->Append(nested_object.release()); | 697 result->Append(std::move(nested_object)); |
| 698 } | 698 } |
| 699 // If there are no entries in the list, there is no need to expose this field. | 699 // If there are no entries in the list, there is no need to expose this field. |
| 700 if (result->empty()) | 700 if (result->empty()) |
| 701 return; | 701 return; |
| 702 onc_object_->SetWithoutPathExpansion(onc_field_name, result.release()); | 702 onc_object_->SetWithoutPathExpansion(onc_field_name, result.release()); |
| 703 } | 703 } |
| 704 | 704 |
| 705 void ShillToONCTranslator::CopyPropertiesAccordingToSignature() { | 705 void ShillToONCTranslator::CopyPropertiesAccordingToSignature() { |
| 706 CopyPropertiesAccordingToSignature(onc_signature_); | 706 CopyPropertiesAccordingToSignature(onc_signature_); |
| 707 } | 707 } |
| (...skipping 70 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 |