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

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

Issue 1852433005: Convert //base to use std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase after r384946 Created 4 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
« no previous file with comments | « base/containers/mru_cache_unittest.cc ('k') | base/containers/scoped_ptr_hash_map_unittest.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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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_CONTAINERS_SCOPED_PTR_HASH_MAP_H_ 5 #ifndef BASE_CONTAINERS_SCOPED_PTR_HASH_MAP_H_
6 #define BASE_CONTAINERS_SCOPED_PTR_HASH_MAP_H_ 6 #define BASE_CONTAINERS_SCOPED_PTR_HASH_MAP_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 9
10 #include <algorithm> 10 #include <algorithm>
11 #include <memory>
11 #include <utility> 12 #include <utility>
12 13
13 #include "base/containers/hash_tables.h" 14 #include "base/containers/hash_tables.h"
14 #include "base/logging.h" 15 #include "base/logging.h"
15 #include "base/macros.h" 16 #include "base/macros.h"
16 #include "base/memory/scoped_ptr.h"
17 #include "base/stl_util.h" 17 #include "base/stl_util.h"
18 18
19 namespace base { 19 namespace base {
20 20
21 // Deprecated. Use std::unordered_map instead. https://crbug.com/579229 21 // Deprecated. Use std::unordered_map instead. https://crbug.com/579229
22 // 22 //
23 // This type acts like a hash_map<K, scoped_ptr<V, D> >, based on top of 23 // This type acts like a hash_map<K, std::unique_ptr<V, D> >, based on top of
24 // base::hash_map. The ScopedPtrHashMap has ownership of all values in the data 24 // base::hash_map. The ScopedPtrHashMap has ownership of all values in the data
25 // structure. 25 // structure.
26 template <typename Key, typename ScopedPtr> 26 template <typename Key, typename ScopedPtr>
27 class ScopedPtrHashMap { 27 class ScopedPtrHashMap {
28 typedef base::hash_map<Key, typename ScopedPtr::element_type*> Container; 28 typedef base::hash_map<Key, typename ScopedPtr::element_type*> Container;
29 29
30 public: 30 public:
31 typedef typename Container::key_type key_type; 31 typedef typename Container::key_type key_type;
32 typedef typename Container::mapped_type mapped_type; 32 typedef typename Container::mapped_type mapped_type;
33 typedef typename Container::value_type value_type; 33 typedef typename Container::value_type value_type;
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
167 167
168 private: 168 private:
169 Container data_; 169 Container data_;
170 170
171 DISALLOW_COPY_AND_ASSIGN(ScopedPtrHashMap); 171 DISALLOW_COPY_AND_ASSIGN(ScopedPtrHashMap);
172 }; 172 };
173 173
174 } // namespace base 174 } // namespace base
175 175
176 #endif // BASE_CONTAINERS_SCOPED_PTR_HASH_MAP_H_ 176 #endif // BASE_CONTAINERS_SCOPED_PTR_HASH_MAP_H_
OLDNEW
« no previous file with comments | « base/containers/mru_cache_unittest.cc ('k') | base/containers/scoped_ptr_hash_map_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698