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

Side by Side Diff: trunk/src/cc/base/scoped_ptr_hash_map.h

Issue 13334005: Revert 191400 "cc: Add ‘chromium_code’: 1 to cc.gyp and cc_t..." (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 7 years, 8 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 | Annotate | Revision Log
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_BASE_SCOPED_PTR_HASH_MAP_H_ 5 #ifndef CC_BASE_SCOPED_PTR_HASH_MAP_H_
6 #define CC_BASE_SCOPED_PTR_HASH_MAP_H_ 6 #define CC_BASE_SCOPED_PTR_HASH_MAP_H_
7 7
8 #include <algorithm> 8 #include <algorithm>
9 #include <utility> 9 #include <utility>
10 10
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 110
111 // Returns the first element in the hash_map that matches the given key. 111 // Returns the first element in the hash_map that matches the given key.
112 // If no such element exists it returns NULL. 112 // If no such element exists it returns NULL.
113 Value* get(const Key& k) const { 113 Value* get(const Key& k) const {
114 const_iterator it = find(k); 114 const_iterator it = find(k);
115 if (it == end()) 115 if (it == end())
116 return 0; 116 return 0;
117 return it->second; 117 return it->second;
118 } 118 }
119 119
120 inline bool contains(const Key& k) const { return data_.count(k) > 0; } 120 inline bool contains(const Key& k) const { return data_.count(k); }
121 121
122 inline void clear() { STLDeleteValues(&data_); } 122 inline void clear() { STLDeleteValues(&data_); }
123 123
124 inline const_iterator find(const Key& k) const { return data_.find(k); } 124 inline const_iterator find(const Key& k) const { return data_.find(k); }
125 inline iterator find(const Key& k) { return data_.find(k); } 125 inline iterator find(const Key& k) { return data_.find(k); }
126 126
127 inline size_t count(const Key& k) const { return data_.count(k); } 127 inline size_t count(const Key& k) const { return data_.count(k); }
128 inline std::pair<const_iterator, const_iterator> equal_range( 128 inline std::pair<const_iterator, const_iterator> equal_range(
129 const Key& k) const { 129 const Key& k) const {
130 return data_.equal_range(k); 130 return data_.equal_range(k);
(...skipping 17 matching lines...) Expand all
148 148
149 private: 149 private:
150 Container data_; 150 Container data_;
151 151
152 DISALLOW_COPY_AND_ASSIGN(ScopedPtrHashMap); 152 DISALLOW_COPY_AND_ASSIGN(ScopedPtrHashMap);
153 }; 153 };
154 154
155 } // namespace cc 155 } // namespace cc
156 156
157 #endif // CC_BASE_SCOPED_PTR_HASH_MAP_H_ 157 #endif // CC_BASE_SCOPED_PTR_HASH_MAP_H_
OLDNEW
« no previous file with comments | « trunk/src/cc/animation/layer_animation_controller_unittest.cc ('k') | trunk/src/cc/base/tiling_data_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698