Index: blimp/common/compositor/webp_decoder.cc |
diff --git a/blimp/common/compositor/webp_decoder.cc b/blimp/common/compositor/webp_decoder.cc |
index ff006c96184fb1a6f1a6ff0ecc50b71e3d383a5b..bc7bb27d568df7a274852dc349630aff18e6cf2e 100644 |
--- a/blimp/common/compositor/webp_decoder.cc |
+++ b/blimp/common/compositor/webp_decoder.cc |
@@ -7,7 +7,6 @@ |
#include "base/lazy_instance.h" |
#include "base/logging.h" |
#include "base/numerics/safe_conversions.h" |
-#include "base/sha1.h" |
#include "base/strings/string_number_conversions.h" |
#include "base/strings/string_util.h" |
Wez
2016/04/23 00:08:52
Do we use string_util.h in here?
nyquist
2016/04/25 08:11:17
Done.
|
#include "blimp/common/blob_cache/blob_cache.h" |
@@ -44,10 +43,8 @@ bool WebPDecoder(const void* input, size_t input_size, SkBitmap* bitmap) { |
return false; |
} |
- // The cache uses the SHA1 hex string of the ID. |
- if (deserialized.id().length() != base::kSHA1Length) { |
- LOG(WARNING) << "Length of ID is not base::kSHA1Length (" |
- << base::kSHA1Length << "), but " |
+ if (!BlobIdHasCorrectLength(BlobId(deserialized.id()))) { |
+ LOG(WARNING) << "Length of ID is not correct " |
<< deserialized.id().length(); |
return false; |
} |
@@ -70,7 +67,7 @@ bool WebPDecoder(const void* input, size_t input_size, SkBitmap* bitmap) { |
cached = g_blob_cache.Get().Get(deserialized.id()); |
webp_data.bytes = reinterpret_cast<const uint8_t*>(cached->data.data()); |
webp_data.size = cached->data.size(); |
- DVLOG(2) << "Found SHA1 " << hex_id << " with size = " << webp_data.size; |
+ DVLOG(2) << "Found id " << hex_id << " with size = " << webp_data.size; |
found_in_cache = true; |
} else { |
// The image was not found in the cache, so decode using the payload. |
@@ -129,7 +126,7 @@ bool WebPDecoder(const void* input, size_t input_size, SkBitmap* bitmap) { |
} |
if (!found_in_cache) { |
- DVLOG(2) << "Inserting image to cache with SHA1: " << hex_id |
+ DVLOG(2) << "Inserting image to cache with id: " << hex_id |
<< " size: " << webp_data.size; |
BlobDataPtr to_cache(new BlobData(std::string( |
reinterpret_cast<const char*>(webp_data.bytes), webp_data.size))); |