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 "base/values.h" | 5 #include "base/values.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/float_util.h" | 9 #include "base/float_util.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 732 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
743 // All other cases: Make a copy and hook it up. | 743 // All other cases: Make a copy and hook it up. |
744 SetWithoutPathExpansion(*key, merge_value->DeepCopy()); | 744 SetWithoutPathExpansion(*key, merge_value->DeepCopy()); |
745 } | 745 } |
746 } | 746 } |
747 } | 747 } |
748 | 748 |
749 void DictionaryValue::Swap(DictionaryValue* other) { | 749 void DictionaryValue::Swap(DictionaryValue* other) { |
750 dictionary_.swap(other->dictionary_); | 750 dictionary_.swap(other->dictionary_); |
751 } | 751 } |
752 | 752 |
753 DictionaryValue::key_iterator::key_iterator(ValueMap::const_iterator itr) { | |
754 itr_ = itr; | |
755 } | |
756 | |
757 DictionaryValue::key_iterator::key_iterator(const key_iterator& rhs) { | |
758 itr_ = rhs.itr_; | |
759 } | |
760 | |
761 DictionaryValue::Iterator::Iterator(const DictionaryValue& target) | |
762 : target_(target), it_(target.dictionary_.begin()) {} | |
jar (doing other things)
2012/08/09 16:30:27
nit: one initializer per line, now that you wrappe
hans
2012/08/09 18:28:48
Done.
| |
763 | |
753 DictionaryValue* DictionaryValue::DeepCopy() const { | 764 DictionaryValue* DictionaryValue::DeepCopy() const { |
754 DictionaryValue* result = new DictionaryValue; | 765 DictionaryValue* result = new DictionaryValue; |
755 | 766 |
756 for (ValueMap::const_iterator current_entry(dictionary_.begin()); | 767 for (ValueMap::const_iterator current_entry(dictionary_.begin()); |
757 current_entry != dictionary_.end(); ++current_entry) { | 768 current_entry != dictionary_.end(); ++current_entry) { |
758 result->SetWithoutPathExpansion(current_entry->first, | 769 result->SetWithoutPathExpansion(current_entry->first, |
759 current_entry->second->DeepCopy()); | 770 current_entry->second->DeepCopy()); |
760 } | 771 } |
761 | 772 |
762 return result; | 773 return result; |
(...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1039 if (lhs_it != end() || rhs_it != other_list->end()) | 1050 if (lhs_it != end() || rhs_it != other_list->end()) |
1040 return false; | 1051 return false; |
1041 | 1052 |
1042 return true; | 1053 return true; |
1043 } | 1054 } |
1044 | 1055 |
1045 ValueSerializer::~ValueSerializer() { | 1056 ValueSerializer::~ValueSerializer() { |
1046 } | 1057 } |
1047 | 1058 |
1048 } // namespace base | 1059 } // namespace base |
OLD | NEW |