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

Side by Side Diff: blimp/common/blob_cache/infinite_blob_cache.h

Issue 1867653002: Initial version of Blimp BlobCache. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Update test name to new API 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
OLDNEW
(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>
11
12 #include "base/macros.h"
13 #include "base/memory/ref_counted.h"
14 #include "base/memory/scoped_ptr.h"
Kevin M 2016/04/13 23:29:52 Remove
nyquist 2016/04/14 19:33:22 Done.
15 #include "blimp/common/blimp_common_export.h"
16 #include "blimp/common/blob_cache/blob_cache.h"
17
18 namespace blimp {
19
20 // InfiniteBlobCache provides an in-memory implementation of BlobCache that
21 // never evicts items.
22 class BLIMP_COMMON_EXPORT InfiniteBlobCache : public BlobCache {
vmpstr 2016/04/13 23:48:02 Since there's only one implementation of BlobCache
nyquist 2016/04/14 19:33:22 The plan is definitely later to use a different im
23 public:
24 InfiniteBlobCache();
25 ~InfiniteBlobCache() override;
26
27 // BlobCache implementation.
28 bool Contains(const std::string& id) const override;
29 void Put(const std::string& id,
30 scoped_refptr<RefCountedVector> data) override;
31 scoped_refptr<RefCountedVector> Get(const std::string& id) const override;
32
33 private:
34 typedef std::map<std::string, scoped_refptr<RefCountedVector>> Cache;
35 Cache map_;
36
37 DISALLOW_COPY_AND_ASSIGN(InfiniteBlobCache);
38 };
39
40 } // namespace blimp
41
42 #endif // BLIMP_COMMON_BLOB_CACHE_INFINITE_BLOB_CACHE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698