| OLD | NEW |
| 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> |
| 9 |
| 8 #include <algorithm> | 10 #include <algorithm> |
| 9 #include <utility> | 11 #include <utility> |
| 10 | 12 |
| 11 #include "base/basictypes.h" | |
| 12 #include "base/containers/hash_tables.h" | 13 #include "base/containers/hash_tables.h" |
| 13 #include "base/logging.h" | 14 #include "base/logging.h" |
| 15 #include "base/macros.h" |
| 14 #include "base/memory/scoped_ptr.h" | 16 #include "base/memory/scoped_ptr.h" |
| 15 #include "base/stl_util.h" | 17 #include "base/stl_util.h" |
| 16 | 18 |
| 17 namespace base { | 19 namespace base { |
| 18 | 20 |
| 19 // This type acts like a hash_map<K, scoped_ptr<V, D> >, based on top of | 21 // This type acts like a hash_map<K, scoped_ptr<V, D> >, based on top of |
| 20 // base::hash_map. The ScopedPtrHashMap has ownership of all values in the data | 22 // base::hash_map. The ScopedPtrHashMap has ownership of all values in the data |
| 21 // structure. | 23 // structure. |
| 22 template <typename Key, typename ScopedPtr> | 24 template <typename Key, typename ScopedPtr> |
| 23 class ScopedPtrHashMap { | 25 class ScopedPtrHashMap { |
| (...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 163 | 165 |
| 164 private: | 166 private: |
| 165 Container data_; | 167 Container data_; |
| 166 | 168 |
| 167 DISALLOW_COPY_AND_ASSIGN(ScopedPtrHashMap); | 169 DISALLOW_COPY_AND_ASSIGN(ScopedPtrHashMap); |
| 168 }; | 170 }; |
| 169 | 171 |
| 170 } // namespace base | 172 } // namespace base |
| 171 | 173 |
| 172 #endif // BASE_CONTAINERS_SCOPED_PTR_HASH_MAP_H_ | 174 #endif // BASE_CONTAINERS_SCOPED_PTR_HASH_MAP_H_ |
| OLD | NEW |