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

Unified Diff: webkit/glue/image_resource_fetcher.h

Issue 149172: Modify ResourceFetcher to use WebURLLoader instead of ResourceHandle.... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 11 years, 5 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: webkit/glue/image_resource_fetcher.h
===================================================================
--- webkit/glue/image_resource_fetcher.h (revision 19821)
+++ webkit/glue/image_resource_fetcher.h (working copy)
@@ -11,35 +11,36 @@
class SkBitmap;
class WebViewImpl;
+namespace webkit_glue {
+
// ImageResourceFetcher handles downloading an image for a webview. Once
// downloading is done the hosting WebViewImpl is notified. ImageResourceFetcher
// is used to download the favicon and images for web apps.
-class ImageResourceFetcher : public ResourceFetcher::Delegate {
+class ImageResourceFetcher {
public:
- ImageResourceFetcher(WebViewImpl* web_view,
+ typedef Callback2<ImageResourceFetcher*, const SkBitmap&>::Type Callback;
+
+ ImageResourceFetcher(const GURL& image_url,
+ WebFrame* frame,
int id,
- const GURL& image_url,
- int image_size);
+ int image_size,
+ Callback* callback);
virtual ~ImageResourceFetcher();
- // ResourceFetcher::Delegate method. Decodes the image and invokes one of
- // DownloadFailed or DownloadedImage.
- virtual void OnURLFetchComplete(const WebCore::ResourceResponse& response,
- const std::string& data);
-
// URL of the image we're downloading.
const GURL& image_url() const { return image_url_; }
- // Hosting WebView.
- WebViewImpl* web_view() const { return web_view_; }
-
// Unique identifier for the request.
int id() const { return id_; }
private:
- WebViewImpl* web_view_;
+ // ResourceFetcher::Callback. Decodes the image and invokes callback_.
+ void OnURLFetchComplete(const WebKit::WebURLResponse& response,
+ const std::string& data);
+ Callback* callback_;
+
// Unique identifier for the request.
const int id_;
@@ -57,4 +58,6 @@
DISALLOW_EVIL_CONSTRUCTORS(ImageResourceFetcher);
};
+} // namespace webkit_glue
+
#endif // WEBKIT_GLUE_IMAGE_RESOURCE_FETCHER_H__

Powered by Google App Engine
This is Rietveld 408576698