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

Unified Diff: components/suggestions/image_manager.h

Issue 630073002: [Suggestions] Create ImageEncoder, to abstract away image encode/decode. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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_manager.h
diff --git a/components/suggestions/image_manager.h b/components/suggestions/image_manager.h
index e538a6b917e2e7581b7585d04f8fbe6f5dd25705..6980db6d1eaf88c1e84b8da10d6246df9ef9d02f 100644
--- a/components/suggestions/image_manager.h
+++ b/components/suggestions/image_manager.h
@@ -28,6 +28,7 @@ class URLRequestContextGetter;
namespace suggestions {
class ImageData;
+class ImageEncoder;
class ImageFetcher;
class SuggestionsProfile;
@@ -38,6 +39,7 @@ class ImageManager : public ImageFetcherDelegate {
typedef std::vector<ImageData> ImageDataVector;
ImageManager(scoped_ptr<ImageFetcher> image_fetcher,
huangs 2014/10/06 17:14:18 Add comments to state that ownerships of |image_fe
Mathieu 2014/10/06 18:13:35 Done.
+ scoped_ptr<ImageEncoder> image_encoder,
scoped_ptr<leveldb_proto::ProtoDatabase<ImageData> > database,
const base::FilePath& database_dir);
virtual ~ImageManager();
@@ -119,11 +121,6 @@ class ImageManager : public ImageFetcherDelegate {
void ServePendingCacheRequests();
- // From SkBitmap to the vector of JPEG-encoded bytes, |dst|. Visible only for
- // testing.
- static bool EncodeImage(const SkBitmap& bitmap,
- std::vector<unsigned char>* dest);
-
// Map from URL to image URL. Should be kept up to date when a new
// SuggestionsProfile is available.
std::map<GURL, GURL> image_url_map_;
@@ -137,6 +134,8 @@ class ImageManager : public ImageFetcherDelegate {
scoped_ptr<ImageFetcher> image_fetcher_;
+ scoped_ptr<ImageEncoder> image_encoder_;
+
scoped_ptr<leveldb_proto::ProtoDatabase<ImageData> > database_;
bool database_ready_;

Powered by Google App Engine
This is Rietveld 408576698