| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/string_util.h" | 8 #include "base/string_util.h" |
| 9 #include "base/utf_string_conversions.h" | 9 #include "base/utf_string_conversions.h" |
| 10 | 10 |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 116 } | 116 } |
| 117 | 117 |
| 118 bool Value::GetAsString(string16* out_value) const { | 118 bool Value::GetAsString(string16* out_value) const { |
| 119 return false; | 119 return false; |
| 120 } | 120 } |
| 121 | 121 |
| 122 bool Value::GetAsList(ListValue** out_value) { | 122 bool Value::GetAsList(ListValue** out_value) { |
| 123 return false; | 123 return false; |
| 124 } | 124 } |
| 125 | 125 |
| 126 bool Value::GetAsList(const ListValue** out_value) const { |
| 127 return false; |
| 128 } |
| 129 |
| 126 Value* Value::DeepCopy() const { | 130 Value* Value::DeepCopy() const { |
| 127 // This method should only be getting called for null Values--all subclasses | 131 // This method should only be getting called for null Values--all subclasses |
| 128 // need to provide their own implementation;. | 132 // need to provide their own implementation;. |
| 129 DCHECK(IsType(TYPE_NULL)); | 133 DCHECK(IsType(TYPE_NULL)); |
| 130 return CreateNullValue(); | 134 return CreateNullValue(); |
| 131 } | 135 } |
| 132 | 136 |
| 133 bool Value::Equals(const Value* other) const { | 137 bool Value::Equals(const Value* other) const { |
| 134 // This method should only be getting called for null Values--all subclasses | 138 // This method should only be getting called for null Values--all subclasses |
| 135 // need to provide their own implementation;. | 139 // need to provide their own implementation;. |
| (...skipping 723 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 859 list_.insert(list_.begin() + index, in_value); | 863 list_.insert(list_.begin() + index, in_value); |
| 860 return true; | 864 return true; |
| 861 } | 865 } |
| 862 | 866 |
| 863 bool ListValue::GetAsList(ListValue** out_value) { | 867 bool ListValue::GetAsList(ListValue** out_value) { |
| 864 if (out_value) | 868 if (out_value) |
| 865 *out_value = this; | 869 *out_value = this; |
| 866 return true; | 870 return true; |
| 867 } | 871 } |
| 868 | 872 |
| 873 bool ListValue::GetAsList(const ListValue** out_value) const { |
| 874 if (out_value) |
| 875 *out_value = this; |
| 876 return true; |
| 877 } |
| 878 |
| 869 ListValue* ListValue::DeepCopy() const { | 879 ListValue* ListValue::DeepCopy() const { |
| 870 ListValue* result = new ListValue; | 880 ListValue* result = new ListValue; |
| 871 | 881 |
| 872 for (ValueVector::const_iterator i(list_.begin()); i != list_.end(); ++i) | 882 for (ValueVector::const_iterator i(list_.begin()); i != list_.end(); ++i) |
| 873 result->Append((*i)->DeepCopy()); | 883 result->Append((*i)->DeepCopy()); |
| 874 | 884 |
| 875 return result; | 885 return result; |
| 876 } | 886 } |
| 877 | 887 |
| 878 bool ListValue::Equals(const Value* other) const { | 888 bool ListValue::Equals(const Value* other) const { |
| (...skipping 10 matching lines...) Expand all Loading... |
| 889 return false; | 899 return false; |
| 890 } | 900 } |
| 891 if (lhs_it != end() || rhs_it != other_list->end()) | 901 if (lhs_it != end() || rhs_it != other_list->end()) |
| 892 return false; | 902 return false; |
| 893 | 903 |
| 894 return true; | 904 return true; |
| 895 } | 905 } |
| 896 | 906 |
| 897 ValueSerializer::~ValueSerializer() { | 907 ValueSerializer::~ValueSerializer() { |
| 898 } | 908 } |
| OLD | NEW |