OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 #import "ios/chrome/browser/snapshots/lru_cache.h" | 5 #import "ios/chrome/browser/snapshots/lru_cache.h" |
6 | 6 |
| 7 #include <stddef.h> |
| 8 |
7 #include "base/containers/hash_tables.h" | 9 #include "base/containers/hash_tables.h" |
8 #include "base/containers/mru_cache.h" | 10 #include "base/containers/mru_cache.h" |
9 #include "base/mac/scoped_nsobject.h" | 11 #include "base/mac/scoped_nsobject.h" |
| 12 #include "base/macros.h" |
10 #include "base/memory/scoped_ptr.h" | 13 #include "base/memory/scoped_ptr.h" |
11 | 14 |
12 namespace { | 15 namespace { |
13 | 16 |
14 class MRUCacheNSObjectDelegate { | 17 class MRUCacheNSObjectDelegate { |
15 public: | 18 public: |
16 MRUCacheNSObjectDelegate(id<LRUCacheDelegate> delegate) | 19 MRUCacheNSObjectDelegate(id<LRUCacheDelegate> delegate) |
17 : delegate_(delegate) {} | 20 : delegate_(delegate) {} |
18 | 21 |
19 MRUCacheNSObjectDelegate(const MRUCacheNSObjectDelegate& other) = default; | 22 MRUCacheNSObjectDelegate(const MRUCacheNSObjectDelegate& other) = default; |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
126 return _cache->empty(); | 129 return _cache->empty(); |
127 } | 130 } |
128 | 131 |
129 #pragma mark - Private | 132 #pragma mark - Private |
130 | 133 |
131 - (void)lruCacheWillEvictObject:(id<NSObject>)obj { | 134 - (void)lruCacheWillEvictObject:(id<NSObject>)obj { |
132 [self.delegate lruCacheWillEvictObject:obj]; | 135 [self.delegate lruCacheWillEvictObject:obj]; |
133 } | 136 } |
134 | 137 |
135 @end | 138 @end |
OLD | NEW |