Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 #include "blimp/common/blob_cache/in_memory_blob_cache.h" | 5 #include "blimp/common/blob_cache/in_memory_blob_cache.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/sha1.h" | |
| 9 #include "base/strings/string_number_conversions.h" | 8 #include "base/strings/string_number_conversions.h" |
| 10 #include "base/strings/string_util.h" | 9 #include "base/strings/string_util.h" |
|
Wez
2016/04/23 00:08:52
Doesn't look like we use either of these headers e
nyquist
2016/04/25 08:11:17
Done.
| |
| 11 | 10 |
| 12 namespace blimp { | 11 namespace blimp { |
| 13 | 12 |
| 14 InMemoryBlobCache::InMemoryBlobCache() {} | 13 InMemoryBlobCache::InMemoryBlobCache() {} |
| 15 | 14 |
| 16 InMemoryBlobCache::~InMemoryBlobCache() {} | 15 InMemoryBlobCache::~InMemoryBlobCache() {} |
| 17 | 16 |
| 18 void InMemoryBlobCache::Put(const BlobId& id, BlobDataPtr data) { | 17 void InMemoryBlobCache::Put(const BlobId& id, BlobDataPtr data) { |
| 19 if (Contains(id)) { | 18 if (Contains(id)) { |
| 20 // In cases where the engine has miscalculated what is already available | 19 // In cases where the engine has miscalculated what is already available |
| (...skipping 11 matching lines...) Expand all Loading... | |
| 32 | 31 |
| 33 BlobDataPtr InMemoryBlobCache::Get(const BlobId& id) const { | 32 BlobDataPtr InMemoryBlobCache::Get(const BlobId& id) const { |
| 34 if (!Contains(id)) { | 33 if (!Contains(id)) { |
| 35 return nullptr; | 34 return nullptr; |
| 36 } | 35 } |
| 37 | 36 |
| 38 return cache_.find(id)->second; | 37 return cache_.find(id)->second; |
| 39 } | 38 } |
| 40 | 39 |
| 41 } // namespace blimp | 40 } // namespace blimp |
| OLD | NEW |