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

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

Issue 2056993003: Add Mojo IPC for seeding new Renderer with Browser's cached blob state. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@blobchannel-master
Patch Set: use a better upstream branch for the patch Created 4 years, 6 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
1 // Copyright 2016 The Chromium Authors. All rights reserved. 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 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 BLIMP_COMMON_BLOB_CACHE_IN_MEMORY_BLOB_CACHE_H_ 5 #ifndef BLIMP_COMMON_BLOB_CACHE_IN_MEMORY_BLOB_CACHE_H_
6 #define BLIMP_COMMON_BLOB_CACHE_IN_MEMORY_BLOB_CACHE_H_ 6 #define BLIMP_COMMON_BLOB_CACHE_IN_MEMORY_BLOB_CACHE_H_
7 7
8 #include <map> 8 #include <map>
9 #include <string> 9 #include <string>
10 #include <vector>
10 11
11 #include "base/macros.h" 12 #include "base/macros.h"
12 #include "base/memory/ref_counted.h" 13 #include "base/memory/ref_counted.h"
13 #include "blimp/common/blimp_common_export.h" 14 #include "blimp/common/blimp_common_export.h"
14 #include "blimp/common/blob_cache/blob_cache.h" 15 #include "blimp/common/blob_cache/blob_cache.h"
15 16
16 namespace blimp { 17 namespace blimp {
17 18
18 // InMemoryBlobCache provides an in-memory implementation of BlobCache that 19 // InMemoryBlobCache provides an in-memory implementation of BlobCache that
19 // never evicts items. 20 // never evicts items.
20 class BLIMP_COMMON_EXPORT InMemoryBlobCache : public BlobCache { 21 class BLIMP_COMMON_EXPORT InMemoryBlobCache : public BlobCache {
21 public: 22 public:
22 InMemoryBlobCache(); 23 InMemoryBlobCache();
23 ~InMemoryBlobCache() override; 24 ~InMemoryBlobCache() override;
24 25
25 // BlobCache implementation. 26 // BlobCache implementation.
27 std::vector<std::string> GetCacheState() const override;
Wez 2016/06/21 00:33:33 std::string->BlobId
Kevin M 2016/06/21 21:23:51 Done.
26 bool Contains(const BlobId& id) const override; 28 bool Contains(const BlobId& id) const override;
27 void Put(const BlobId& id, BlobDataPtr data) override; 29 void Put(const BlobId& id, BlobDataPtr data) override;
28 BlobDataPtr Get(const BlobId& id) const override; 30 BlobDataPtr Get(const BlobId& id) const override;
29 31
30 private: 32 private:
31 std::map<const BlobId, BlobDataPtr> cache_; 33 std::map<const BlobId, BlobDataPtr> cache_;
32 34
33 DISALLOW_COPY_AND_ASSIGN(InMemoryBlobCache); 35 DISALLOW_COPY_AND_ASSIGN(InMemoryBlobCache);
34 }; 36 };
35 37
36 } // namespace blimp 38 } // namespace blimp
37 39
38 #endif // BLIMP_COMMON_BLOB_CACHE_IN_MEMORY_BLOB_CACHE_H_ 40 #endif // BLIMP_COMMON_BLOB_CACHE_IN_MEMORY_BLOB_CACHE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698