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

Unified Diff: components/suggestions/image_manager.h

Issue 2000653002: Replace the usage of SkBitmap with gfx::Image in the suggestion service. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Replace SkBitmap with gfx::Image in the suggestions_service interface Created 4 years, 7 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 518000d57f1c9e32519052e60ccfc2084d5b70ae..bb45f37eb64c420265452f307316d6fafb4ad532 100644
--- a/components/suggestions/image_manager.h
+++ b/components/suggestions/image_manager.h
@@ -24,6 +24,10 @@
#include "ui/gfx/image/image_skia.h"
Marc Treib 2016/05/20 14:40:04 Not your doing, but is this include needed?
markusheintz_ 2016/05/23 13:20:47 Replaced with an include for SkBitmap This requir
Marc Treib 2016/05/23 13:44:03 Ah, okay. If this requires extra approvals for the
markusheintz_ 2016/05/24 08:32:31 Done.
#include "url/gurl.h"
+namespace gfx {
+class Image;
+}
+
namespace image_fetcher {
class ImageFetcher;
}
@@ -58,7 +62,7 @@ class ImageManager : public image_fetcher::ImageFetcherDelegate {
// Should be called from the UI thread.
virtual void GetImageForURL(
const GURL& url,
- base::Callback<void(const GURL&, const SkBitmap*)> callback);
+ base::Callback<void(const GURL&, const gfx::Image&)> callback);
protected:
// Methods inherited from image_fetcher::ImageFetcherDelegate
@@ -78,7 +82,7 @@ class ImageManager : public image_fetcher::ImageFetcherDelegate {
// Used for testing.
ImageManager();
- typedef std::vector<base::Callback<void(const GURL&, const SkBitmap*)> >
+ typedef std::vector<base::Callback<void(const GURL&, const gfx::Image&)> >
CallbackVector;
typedef base::hash_map<std::string, scoped_refptr<base::RefCountedMemory>>
ImageMap;
@@ -105,16 +109,16 @@ class ImageManager : public image_fetcher::ImageFetcherDelegate {
void QueueCacheRequest(
const GURL& url, const GURL& image_url,
- base::Callback<void(const GURL&, const SkBitmap*)> callback);
+ base::Callback<void(const GURL&, const gfx::Image&)> callback);
noyau (Ping after 24h) 2016/05/20 15:15:59 You are using this callback type in 4 places just
markusheintz_ 2016/05/23 13:20:47 Done
void ServeFromCacheOrNetwork(
const GURL& url, const GURL& image_url,
- base::Callback<void(const GURL&, const SkBitmap*)> callback);
+ base::Callback<void(const GURL&, const gfx::Image&)> callback);
void OnCacheImageDecoded(
const GURL& url,
const GURL& image_url,
- base::Callback<void(const GURL&, const SkBitmap*)> callback,
+ const base::Callback<void(const GURL&, const gfx::Image&)>& callback,
std::unique_ptr<SkBitmap> bitmap);
// Returns null if the |url| had no entry in the cache.

Powered by Google App Engine
This is Rietveld 408576698