| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 CHROME_BROWSER_ANDROID_THUMBNAIL_SCOPED_PTR_EXPIRING_CACHE_H_ | 5 #ifndef CHROME_BROWSER_ANDROID_THUMBNAIL_SCOPED_PTR_EXPIRING_CACHE_H_ |
| 6 #define CHROME_BROWSER_ANDROID_THUMBNAIL_SCOPED_PTR_EXPIRING_CACHE_H_ | 6 #define CHROME_BROWSER_ANDROID_THUMBNAIL_SCOPED_PTR_EXPIRING_CACHE_H_ |
| 7 | 7 |
| 8 #include <stddef.h> |
| 9 |
| 10 #include "base/macros.h" |
| 8 #include "base/memory/scoped_ptr.h" | 11 #include "base/memory/scoped_ptr.h" |
| 9 #include "net/base/linked_hash_map.h" | 12 #include "net/base/linked_hash_map.h" |
| 10 | 13 |
| 11 template <class Key, class Value> | 14 template <class Key, class Value> |
| 12 class ScopedPtrExpiringCache { | 15 class ScopedPtrExpiringCache { |
| 13 private: | 16 private: |
| 14 typedef linked_hash_map<Key, Value*> LinkedHashMap; | 17 typedef linked_hash_map<Key, Value*> LinkedHashMap; |
| 15 | 18 |
| 16 public: | 19 public: |
| 17 typedef typename LinkedHashMap::iterator iterator; | 20 typedef typename LinkedHashMap::iterator iterator; |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 63 } | 66 } |
| 64 } | 67 } |
| 65 | 68 |
| 66 size_t max_cache_size_; | 69 size_t max_cache_size_; |
| 67 LinkedHashMap map_; | 70 LinkedHashMap map_; |
| 68 | 71 |
| 69 DISALLOW_COPY_AND_ASSIGN(ScopedPtrExpiringCache); | 72 DISALLOW_COPY_AND_ASSIGN(ScopedPtrExpiringCache); |
| 70 }; | 73 }; |
| 71 | 74 |
| 72 #endif // CHROME_BROWSER_ANDROID_THUMBNAIL_SCOPED_PTR_EXPIRING_CACHE_H_ | 75 #endif // CHROME_BROWSER_ANDROID_THUMBNAIL_SCOPED_PTR_EXPIRING_CACHE_H_ |
| OLD | NEW |