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

Unified Diff: cc/base/scoped_ptr_vector.h

Issue 15435003: cc: Add CopyAsBitmapRequest class to hold the readback callback. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: nolint Created 7 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
« no previous file with comments | « no previous file | cc/base/scoped_ptr_vector_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/base/scoped_ptr_vector.h
diff --git a/cc/base/scoped_ptr_vector.h b/cc/base/scoped_ptr_vector.h
index 01f4d3d0fc4ed795eeee78feab7d35839e009d85..8cd368d885ce3f72a2b962c06b2958fa4ba05dec 100644
--- a/cc/base/scoped_ptr_vector.h
+++ b/cc/base/scoped_ptr_vector.h
@@ -33,7 +33,7 @@ class ScopedPtrVector {
// to methods on the ScopedPtrVector class to appear in the vector.
class iterator : public std::vector<T*>::iterator {
public:
- iterator(const typename std::vector<T*>::iterator& other)
+ iterator(const typename std::vector<T*>::iterator& other) // NOLINT
: std::vector<T*>::iterator(other) {}
T* const& operator*() { return std::vector<T*>::iterator::operator*(); }
};
@@ -129,6 +129,17 @@ class ScopedPtrVector {
data_.insert(position, item.release());
}
+ void insert_and_take(iterator position,
+ ScopedPtrVector<T>& other) {
+ std::vector<T*> tmp_data;
+ for (ScopedPtrVector<T>::iterator it = other.begin();
+ it != other.end();
+ ++it) {
+ tmp_data.push_back(other.take(it).release());
+ }
+ data_.insert(position, tmp_data.begin(), tmp_data.end());
+ }
+
void swap(ScopedPtrVector<T>& other) {
data_.swap(other.data_);
}
« no previous file with comments | « no previous file | cc/base/scoped_ptr_vector_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698