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

Side by Side Diff: cc/scoped_ptr_vector.h

Issue 11417111: cc: Add PictureLayerTilingSet to manage PictureLayerTiling (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix win_rel Created 8 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « cc/region.cc ('k') | cc/test/fake_picture_layer_tiling_client.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CC_SCOPED_PTR_VECTOR_H_ 5 #ifndef CC_SCOPED_PTR_VECTOR_H_
6 #define CC_SCOPED_PTR_VECTOR_H_ 6 #define CC_SCOPED_PTR_VECTOR_H_
7 7
8 #include "base/basictypes.h" 8 #include "base/basictypes.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 data_[index] = NULL; 60 data_[index] = NULL;
61 return ret.Pass(); 61 return ret.Pass();
62 } 62 }
63 63
64 void remove(size_t index) { 64 void remove(size_t index) {
65 DCHECK(index < size()); 65 DCHECK(index < size());
66 delete data_[index]; 66 delete data_[index];
67 data_.erase(data_.begin() + index); 67 data_.erase(data_.begin() + index);
68 } 68 }
69 69
70 void reserve(size_t size) {
71 data_.reserve(size);
72 }
73
70 void clear() { 74 void clear() {
71 STLDeleteElements(&data_); 75 STLDeleteElements(&data_);
72 } 76 }
73 77
74 void append(scoped_ptr<T> item) { 78 void append(scoped_ptr<T> item) {
75 data_.push_back(item.release()); 79 data_.push_back(item.release());
76 } 80 }
77 81
78 void insert(size_t index, scoped_ptr<T> item) { 82 void insert(size_t index, scoped_ptr<T> item) {
79 DCHECK(index < size()); 83 DCHECK(index < size());
(...skipping 12 matching lines...) Expand all
92 96
93 private: 97 private:
94 std::vector<T*> data_; 98 std::vector<T*> data_;
95 99
96 DISALLOW_COPY_AND_ASSIGN(ScopedPtrVector); 100 DISALLOW_COPY_AND_ASSIGN(ScopedPtrVector);
97 }; 101 };
98 102
99 } // namespace cc 103 } // namespace cc
100 104
101 #endif // CC_SCOPED_PTR_VECTOR_H_ 105 #endif // CC_SCOPED_PTR_VECTOR_H_
OLDNEW
« no previous file with comments | « cc/region.cc ('k') | cc/test/fake_picture_layer_tiling_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698