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

Unified Diff: blimp/common/blob_cache/in_memory_blob_cache.cc

Issue 2626423004: Remove all //blimp code. (Closed)
Patch Set: One last(?) `git merge` for good measure. Created 3 years, 11 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 side-by-side diff with in-line comments
Download patch
Index: blimp/common/blob_cache/in_memory_blob_cache.cc
diff --git a/blimp/common/blob_cache/in_memory_blob_cache.cc b/blimp/common/blob_cache/in_memory_blob_cache.cc
deleted file mode 100644
index 43d7f106a60facffcd85f7e4fa1f019e1e857898..0000000000000000000000000000000000000000
--- a/blimp/common/blob_cache/in_memory_blob_cache.cc
+++ /dev/null
@@ -1,48 +0,0 @@
-// Copyright 2016 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "blimp/common/blob_cache/in_memory_blob_cache.h"
-
-#include <utility>
-
-#include "base/logging.h"
-
-namespace blimp {
-
-InMemoryBlobCache::InMemoryBlobCache() {}
-
-InMemoryBlobCache::~InMemoryBlobCache() {}
-
-std::vector<BlobId> InMemoryBlobCache::GetCachedBlobIds() const {
- std::vector<BlobId> cached_ids;
- for (const auto& blob_id_and_data_pair : cache_) {
- cached_ids.push_back(blob_id_and_data_pair.first);
- }
- return cached_ids;
-}
-
-void InMemoryBlobCache::Put(const BlobId& id, BlobDataPtr data) {
- if (Contains(id)) {
- // In cases where the engine has miscalculated what is already available
- // on the client, Put() might be called unnecessarily, which should be
- // ignored.
- VLOG(2) << "Item with ID " << id << " already exists in cache.";
- return;
- }
- cache_.insert(std::make_pair(id, std::move(data)));
-}
-
-bool InMemoryBlobCache::Contains(const BlobId& id) const {
- return cache_.find(id) != cache_.end();
-}
-
-BlobDataPtr InMemoryBlobCache::Get(const BlobId& id) const {
- if (!Contains(id)) {
- return nullptr;
- }
-
- return cache_.find(id)->second;
-}
-
-} // namespace blimp
« no previous file with comments | « blimp/common/blob_cache/in_memory_blob_cache.h ('k') | blimp/common/blob_cache/in_memory_blob_cache_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698