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

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

Issue 14689004: Re-land: cc: Cancel and re-prioritize worker pool tasks. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Check and prevent worker pool reentrancy during dispatch of completion callbacks Created 7 years, 6 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 | « no previous file | cc/base/worker_pool.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_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 13 matching lines...) Expand all
24 typedef base::hash_map<Key, Value*> Container; 24 typedef base::hash_map<Key, Value*> Container;
25 25
26 public: 26 public:
27 typedef typename Container::iterator iterator; 27 typedef typename Container::iterator iterator;
28 typedef typename Container::const_iterator const_iterator; 28 typedef typename Container::const_iterator const_iterator;
29 29
30 ScopedPtrHashMap() {} 30 ScopedPtrHashMap() {}
31 31
32 ~ScopedPtrHashMap() { clear(); } 32 ~ScopedPtrHashMap() { clear(); }
33 33
34 void swap(ScopedPtrHashMap<Key, Value*>& other) { 34 void swap(ScopedPtrHashMap<Key, Value>& other) {
35 data_.swap(other.data_); 35 data_.swap(other.data_);
36 } 36 }
37 37
38 std::pair<iterator, bool> insert( 38 std::pair<iterator, bool> insert(
39 std::pair<Key, const scoped_ptr<Value> > pair) { 39 std::pair<Key, const scoped_ptr<Value> > pair) {
40 return data_.insert( 40 return data_.insert(
41 std::pair<Key, Value*>(pair.first, pair.second.release())); 41 std::pair<Key, Value*>(pair.first, pair.second.release()));
42 } 42 }
43 43
44 // Replaces value but not key if key is already present. 44 // Replaces value but not key if key is already present.
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 | « no previous file | cc/base/worker_pool.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698