base: Fix the TODO in ListValue::Remove().

Change the return type of Remove() to bool, and add a size_t output parameter.

BUG=None
TEST=None

[email protected]

Review URL: http://codereview.chromium.org/7618021

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@96702 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/base/values.cc b/base/values.cc
index b215812..7a364bd 100644
--- a/base/values.cc
+++ b/base/values.cc
@@ -818,21 +818,19 @@
   return true;
 }
 
-int ListValue::Remove(const Value& value) {
+bool ListValue::Remove(const Value& value, size_t* index) {
   for (ValueVector::iterator i(list_.begin()); i != list_.end(); ++i) {
     if ((*i)->Equals(&value)) {
-      size_t index = i - list_.begin();
+      size_t previous_index = i - list_.begin();
       delete *i;
       list_.erase(i);
 
-      // TODO(anyone): Returning a signed int type here is just wrong.
-      // Change this interface to return a size_t.
-      DCHECK(index <= INT_MAX);
-      int return_index = static_cast<int>(index);
-      return return_index;
+      if (index)
+        *index = previous_index;
+      return true;
     }
   }
-  return -1;
+  return false;
 }
 
 void ListValue::Append(Value* in_value) {