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

Unified Diff: base/scoped_vector.h

Issue 3163003: Mac tabpose: Add thumbnails (Closed)
Patch Set: '' Created 10 years, 4 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
« no previous file with comments | « no previous file | chrome/browser/cocoa/tab_strip_controller.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/scoped_vector.h
diff --git a/base/scoped_vector.h b/base/scoped_vector.h
index b797078572b8acbfe9be1864af17927c890dddea..b9d23fe2f2bdc4b3f5060b405ab116b96f6243ea 100644
--- a/base/scoped_vector.h
+++ b/base/scoped_vector.h
@@ -56,6 +56,30 @@ class ScopedVector {
void reset() { STLDeleteElements(&v); }
void resize(size_t new_size) { v.resize(new_size); }
+ // Lets the ScopedVector take ownership of |x|.
+ iterator insert(iterator position, T* x) {
+ return v.insert(position, x);
+ }
+
+ iterator erase(iterator position) {
+ delete *position;
+ return v.erase(position);
+ }
+
+ iterator erase(iterator first, iterator last) {
+ STLDeleteContainerPointers(first, last);
+ return v.erase(first, last);
+ }
+
+ // Like |erase()|, but doesn't delete the element at |position|.
+ iterator weak_erase(iterator position) {
+ return v.erase(position);
+ }
+
+ // Like |erase()|, but doesn't delete the elements in [first, last).
+ iterator weak_erase(iterator first, iterator last) {
+ return v.erase(first, last);
+ }
private:
std::vector<T*> v;
« no previous file with comments | « no previous file | chrome/browser/cocoa/tab_strip_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698