OLD | NEW |
---|---|
(Empty) | |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef BLIMP_COMMON_BLOB_CACHE_INFINITE_BLOB_CACHE_H_ | |
6 #define BLIMP_COMMON_BLOB_CACHE_INFINITE_BLOB_CACHE_H_ | |
7 | |
8 #include <map> | |
9 #include <string> | |
10 #include <vector> | |
Kevin M
2016/04/14 20:08:30
Necessary?
nyquist
2016/04/15 01:27:12
Done.
| |
11 | |
12 #include "base/macros.h" | |
13 #include "base/memory/ref_counted.h" | |
14 #include "blimp/common/blimp_common_export.h" | |
15 #include "blimp/common/blob_cache/blob_cache.h" | |
16 | |
17 namespace blimp { | |
18 | |
19 // InfiniteBlobCache provides an in-memory implementation of BlobCache that | |
20 // never evicts items. | |
21 class BLIMP_COMMON_EXPORT InfiniteBlobCache : public BlobCache { | |
Kevin M
2016/04/14 20:08:30
InMemoryBlobCache (suggested by Wez because the na
nyquist
2016/04/15 01:27:12
Done.
| |
22 public: | |
23 InfiniteBlobCache(); | |
24 ~InfiniteBlobCache() override; | |
25 | |
26 // BlobCache implementation. | |
27 bool Contains(const std::string& id) const override; | |
28 void Put(const std::string& id, | |
29 scoped_refptr<RefCountedVector> data) override; | |
30 scoped_refptr<RefCountedVector> Get(const std::string& id) const override; | |
31 | |
32 private: | |
33 typedef std::map<std::string, scoped_refptr<RefCountedVector>> Cache; | |
34 Cache map_; | |
35 | |
36 DISALLOW_COPY_AND_ASSIGN(InfiniteBlobCache); | |
37 }; | |
38 | |
39 } // namespace blimp | |
40 | |
41 #endif // BLIMP_COMMON_BLOB_CACHE_INFINITE_BLOB_CACHE_H_ | |
OLD | NEW |