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

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

Issue 12676029: cc: Fix capitalization style in chromified files. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 9 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
« no previous file with comments | « cc/base/region_unittest.cc ('k') | cc/base/tiling_data.cc » ('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_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 "base/basictypes.h" 8 #include "base/basictypes.h"
9 #include "base/hash_tables.h" 9 #include "base/hash_tables.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 24 matching lines...) Expand all
35 std::pair<Key, const scoped_ptr<Value> > pair) { 35 std::pair<Key, const scoped_ptr<Value> > pair) {
36 return data_.insert( 36 return data_.insert(
37 std::pair<Key, Value*>(pair.first, pair.second.release())); 37 std::pair<Key, Value*>(pair.first, pair.second.release()));
38 } 38 }
39 39
40 // Replaces value but not key if key is already present. 40 // Replaces value but not key if key is already present.
41 std::pair<iterator, bool> set(Key key, scoped_ptr<Value> data) { 41 std::pair<iterator, bool> set(Key key, scoped_ptr<Value> data) {
42 iterator it = find(key); 42 iterator it = find(key);
43 if (it != end()) 43 if (it != end())
44 erase(it); 44 erase(it);
45 Value* rawPtr = data.release(); 45 Value* raw_ptr = data.release();
46 return data_.insert(std::pair<Key, Value*>(key, rawPtr)); 46 return data_.insert(std::pair<Key, Value*>(key, raw_ptr));
47 } 47 }
48 48
49 // Does nothing if key is already present 49 // Does nothing if key is already present
50 std::pair<iterator, bool> add(Key key, scoped_ptr<Value> data) { 50 std::pair<iterator, bool> add(Key key, scoped_ptr<Value> data) {
51 Value* rawPtr = data.release(); 51 Value* raw_ptr = data.release();
52 return data_.insert(std::pair<Key, Value*>(key, rawPtr)); 52 return data_.insert(std::pair<Key, Value*>(key, raw_ptr));
53 } 53 }
54 54
55 void erase(iterator it) { 55 void erase(iterator it) {
56 if (it->second) 56 if (it->second)
57 delete it->second; 57 delete it->second;
58 data_.erase(it); 58 data_.erase(it);
59 } 59 }
60 60
61 size_t erase(const Key& k) { 61 size_t erase(const Key& k) {
62 iterator it = data_.find(k); 62 iterator it = data_.find(k);
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
144 144
145 private: 145 private:
146 Container data_; 146 Container data_;
147 147
148 DISALLOW_COPY_AND_ASSIGN(ScopedPtrHashMap); 148 DISALLOW_COPY_AND_ASSIGN(ScopedPtrHashMap);
149 }; 149 };
150 150
151 } // namespace cc 151 } // namespace cc
152 152
153 #endif // CC_BASE_SCOPED_PTR_HASH_MAP_H_ 153 #endif // CC_BASE_SCOPED_PTR_HASH_MAP_H_
OLDNEW
« no previous file with comments | « cc/base/region_unittest.cc ('k') | cc/base/tiling_data.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698