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

Unified Diff: components/image_fetcher/image_fetcher_delegate.h

Issue 2047713002: [NTP Snippets] Cache images in a LevelDB (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@protodb_get
Patch Set: add TODOs Created 4 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/image_fetcher/image_fetcher_delegate.h
diff --git a/components/image_fetcher/image_fetcher_delegate.h b/components/image_fetcher/image_fetcher_delegate.h
index dc5b83fbea9a2c90beed04bf02b2c745785abf31..38d66b29543987477deaa42660f306e40d538aa4 100644
--- a/components/image_fetcher/image_fetcher_delegate.h
+++ b/components/image_fetcher/image_fetcher_delegate.h
@@ -5,9 +5,9 @@
#ifndef COMPONENTS_IMAGE_FETCHER_IMAGE_FETCHER_DELEGATE_H_
#define COMPONENTS_IMAGE_FETCHER_IMAGE_FETCHER_DELEGATE_H_
-#include "base/macros.h"
+#include <string>
-class GURL;
+#include "base/macros.h"
namespace gfx {
class Image;
@@ -19,11 +19,18 @@ class ImageFetcherDelegate {
public:
ImageFetcherDelegate() {}
- // Called when an image was fetched. |id| is an identifier for the fetch (as
- // passed to ImageFetcher::StartOrQueueNetworkRequest); |image| stores image
- // data owned by the caller, and can be an empty gfx::Image.
+ // Called when the data for an image was fetched. |id| is an identifier for
+ // the fetch (as passed to ImageFetcher::StartOrQueueNetworkRequest); |data|
+ // stores (generally compressed) image data owned by the caller, and can be
+ // empty if the fetch failed.
+ virtual void OnImageDataFetched(const std::string& id,
+ const std::string& data) {};
+
+ // Called when an image was fetched and decoded. |id| is an identifier for the
+ // fetch (as passed to ImageFetcher::StartOrQueueNetworkRequest); |image|
+ // stores image data owned by the caller, and can be an empty gfx::Image.
virtual void OnImageFetched(const std::string& id,
- const gfx::Image& image) = 0;
+ const gfx::Image& image) {};
protected:
virtual ~ImageFetcherDelegate() {}
« no previous file with comments | « chrome/browser/search/suggestions/image_fetcher_impl.cc ('k') | components/ntp_snippets/ntp_snippets_database.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698