| Index: components/suggestions/image_manager.h
|
| diff --git a/components/suggestions/image_manager.h b/components/suggestions/image_manager.h
|
| index 99ae55e1a34c54a43751a4c6a27f01dff1093417..bc06d5a2df3e7a3937a209aefe7f7e1d34f0e1d3 100644
|
| --- a/components/suggestions/image_manager.h
|
| +++ b/components/suggestions/image_manager.h
|
| @@ -12,6 +12,7 @@
|
| #include "base/basictypes.h"
|
| #include "base/callback.h"
|
| #include "base/containers/hash_tables.h"
|
| +#include "base/memory/ref_counted_memory.h"
|
| #include "base/memory/scoped_ptr.h"
|
| #include "base/memory/weak_ptr.h"
|
| #include "base/threading/thread_checker.h"
|
| @@ -66,7 +67,8 @@ class ImageManager : public ImageFetcherDelegate {
|
|
|
| typedef std::vector<base::Callback<void(const GURL&, const SkBitmap*)> >
|
| CallbackVector;
|
| - typedef base::hash_map<std::string, SkBitmap> ImageMap;
|
| + typedef base::hash_map<std::string, scoped_refptr<base::RefCountedMemory> >
|
| + ImageMap;
|
|
|
| // State related to an image fetch (associated website url, image_url,
|
| // pending callbacks).
|
| @@ -95,14 +97,14 @@ class ImageManager : public ImageFetcherDelegate {
|
| const GURL& url, const GURL& image_url,
|
| base::Callback<void(const GURL&, const SkBitmap*)> callback);
|
|
|
| - // Will return false if no bitmap was found corresponding to |url|, else
|
| - // return true and call |callback| with the found bitmap.
|
| - bool ServeFromCache(
|
| - const GURL& url,
|
| - base::Callback<void(const GURL&, const SkBitmap*)> callback);
|
| + void OnCacheImageDecoded(
|
| + const GURL& url, const GURL& image_url,
|
| + base::Callback<void(const GURL&, const SkBitmap*)> callback,
|
| + scoped_ptr<SkBitmap> bitmap);
|
|
|
| // Returns null if the |url| had no entry in the cache.
|
| - SkBitmap* GetBitmapFromCache(const GURL& url);
|
| + scoped_refptr<base::RefCountedMemory> GetEncodedImageFromCache(
|
| + const GURL& url);
|
|
|
| // Save the image bitmap in the cache and in the database.
|
| void SaveImage(const GURL& url, const SkBitmap& bitmap);
|
|
|