Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(661)

Unified Diff: base/values.cc

Issue 115149: Implement the popup blocking whitelist pref. This makes the whitelist actual... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: base/values.cc
===================================================================
--- base/values.cc (revision 15654)
+++ base/values.cc (working copy)
@@ -497,11 +497,8 @@
}
void ListValue::Clear() {
- ValueVector::iterator list_iterator = list_.begin();
- while (list_iterator != list_.end()) {
- delete *list_iterator;
- ++list_iterator;
- }
+ for (ValueVector::iterator i(list_.begin()); i != list_.end(); ++i)
+ delete *i;
list_.clear();
}
@@ -609,13 +606,19 @@
else
delete list_[index];
- ValueVector::iterator entry = list_.begin();
- entry += index;
-
- list_.erase(entry);
+ list_.erase(list_.begin() + index);
return true;
}
+void ListValue::Remove(Value* in_value) {
+ for (ValueVector::iterator i(list_.begin()); i != list_.end(); ++i) {
+ if ((*i)->Equals(in_value)) {
+ list_.erase(i);
+ break;
+ }
+ }
+}
+
void ListValue::Append(Value* in_value) {
DCHECK(in_value);
list_.push_back(in_value);
@@ -624,11 +627,8 @@
Value* ListValue::DeepCopy() const {
ListValue* result = new ListValue;
- ValueVector::const_iterator current_entry = list_.begin();
- while (current_entry != list_.end()) {
- result->Append((*current_entry)->DeepCopy());
- ++current_entry;
- }
+ for (ValueVector::const_iterator i(list_.begin()); i != list_.end(); ++i)
+ result->Append((*i)->DeepCopy());
return result;
}
« base/values.h ('K') | « base/values.h ('k') | chrome/browser/browser_prefs.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698