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

Unified Diff: base/memory/scoped_vector.h

Issue 25293002: Add DiscardableMemoryAllocator to work around FD limit issue. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address William's comments Created 7 years, 1 month 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/memory/scoped_vector.h
diff --git a/base/memory/scoped_vector.h b/base/memory/scoped_vector.h
index 59144c0e82ac600337f249dc41154a66652de33b..61227e22d1f97adb8e1de54465ae508866293f65 100644
--- a/base/memory/scoped_vector.h
+++ b/base/memory/scoped_vector.h
@@ -64,6 +64,12 @@ class ScopedVector {
void push_back(T* elem) { v_.push_back(elem); }
+ void pop_back() {
+ DCHECK(!empty());
willchan no longer on Chromium 2013/11/28 17:44:19 Add logging.h for this.
Philippe 2013/11/29 12:41:05 Done.
+ delete v_.back();
+ v_.pop_back();
+ }
+
std::vector<T*>& get() { return v_; }
const std::vector<T*>& get() const { return v_; }
void swap(std::vector<T*>& other) { v_.swap(other); }

Powered by Google App Engine
This is Rietveld 408576698