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

Unified Diff: components/suggestions/image_encoder.h

Issue 1156003008: Decode ImageManager cached images on demand. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Don't use MessageLoop API Created 5 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 side-by-side diff with in-line comments
Download patch
Index: components/suggestions/image_encoder.h
diff --git a/components/suggestions/image_encoder.h b/components/suggestions/image_encoder.h
index f32314ab0e052c9528fb7c0470a50aa7dd555e0d..d0aa71d5f1c571fc0b47cbbf84a8792e7d5b9452 100644
--- a/components/suggestions/image_encoder.h
+++ b/components/suggestions/image_encoder.h
@@ -5,6 +5,7 @@
#ifndef COMPONENTS_SUGGESTIONS_IMAGE_ENCODER_H_
#define COMPONENTS_SUGGESTIONS_IMAGE_ENCODER_H_
+#include <stddef.h>
#include <vector>
class SkBitmap;
@@ -13,7 +14,12 @@ namespace suggestions {
// From encoded bytes to SkBitmap. It's the caller's responsibility to delete
// the bitmap.
-SkBitmap* DecodeJPEGToSkBitmap(const std::vector<unsigned char>& encoded_data);
+SkBitmap* DecodeJPEGToSkBitmap(const void* encoded_data, size_t size);
+
+inline SkBitmap* DecodeJPEGToSkBitmap(
+ const std::vector<unsigned char>& encoded_data) {
+ return DecodeJPEGToSkBitmap(&encoded_data[0], encoded_data.size());
+}
// From SkBitmap to a vector of JPEG-encoded bytes, |dst|.
bool EncodeSkBitmapToJPEG(const SkBitmap& bitmap,
« no previous file with comments | « chrome/browser/search/suggestions/suggestions_service_factory.cc ('k') | components/suggestions/image_encoder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698