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

Side by Side Diff: base/scoped_vector.h

Issue 552004: Style cleanup in preparation for auto-linting base/. (Closed)
Patch Set: Created 10 years, 11 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 unified diff | Download patch
« no previous file with comments | « base/scoped_nsdisable_screen_updates.h ('k') | base/sha2.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 (c) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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 BASE_SCOPED_VECTOR_H_ 5 #ifndef BASE_SCOPED_VECTOR_H_
6 #define BASE_SCOPED_VECTOR_H_ 6 #define BASE_SCOPED_VECTOR_H_
7 7
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 21 matching lines...) Expand all
32 iterator begin() { return v.begin(); } 32 iterator begin() { return v.begin(); }
33 const_iterator begin() const { return v.begin(); } 33 const_iterator begin() const { return v.begin(); }
34 iterator end() { return v.end(); } 34 iterator end() { return v.end(); }
35 const_iterator end() const { return v.end(); } 35 const_iterator end() const { return v.end(); }
36 36
37 void push_back(T* elem) { v.push_back(elem); } 37 void push_back(T* elem) { v.push_back(elem); }
38 38
39 std::vector<T*>& get() { return v; } 39 std::vector<T*>& get() { return v; }
40 const std::vector<T*>& get() const { return v; } 40 const std::vector<T*>& get() const { return v; }
41 void swap(ScopedVector<T>& other) { v.swap(other.v); } 41 void swap(ScopedVector<T>& other) { v.swap(other.v); }
42 void release(std::vector<T*>* out) { out->swap(v); v.clear(); } 42 void release(std::vector<T*>* out) {
43 out->swap(v);
44 v.clear();
45 }
43 46
44 void reset() { STLDeleteElements(&v); } 47 void reset() { STLDeleteElements(&v); }
45 48
46 private: 49 private:
47 std::vector<T*> v; 50 std::vector<T*> v;
48 51
49 DISALLOW_COPY_AND_ASSIGN(ScopedVector); 52 DISALLOW_COPY_AND_ASSIGN(ScopedVector);
50 }; 53 };
51 54
52 #endif // BASE_SCOPED_VECTOR_H_ 55 #endif // BASE_SCOPED_VECTOR_H_
OLDNEW
« no previous file with comments | « base/scoped_nsdisable_screen_updates.h ('k') | base/sha2.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698