Index: base/values.cc |
diff --git a/base/values.cc b/base/values.cc |
index f214ead4ee41a03bc4aff0ba6ad914bfb9085a89..feff299dbe2a57a8d8061fb77ec342e1c94745db 100644 |
--- a/base/values.cc |
+++ b/base/values.cc |
@@ -832,6 +832,16 @@ void ListValue::Append(Value* in_value) { |
list_.push_back(in_value); |
} |
+bool ListValue::AppendIfNotPresent(Value* in_value) { |
+ DCHECK(in_value); |
+ for (ValueVector::iterator i(list_.begin()); i != list_.end(); ++i) { |
+ if ((*i)->Equals(in_value)) |
+ return false; |
+ } |
+ list_.push_back(in_value); |
+ return true; |
+} |
+ |
bool ListValue::Insert(size_t index, Value* in_value) { |
DCHECK(in_value); |
if (index > list_.size()) |