Split FaviconHelper in two: ImageLoadingHelper and FaviconHelper.
This is the first step of fixing http://crbug.com/196769.
The problem is that there are two types of users of Content::DownloadFavicon() - the favicon consumers and regular icons and images consumers. Recently, the otherwise-generic image download+decoding implementation regressed because it was assumed to be only used for favicon loading.
The proposed fix is to add a parameter to the method (enum, FAVICON/IMAGE) and rename it from DownloadFavicon to DownloadImage, to make sure the name corresponds to the impl/usage.
This is rename-only part, no additional parameter yet. The FaviconHelper class was split in 2, with new ImageLoadingHelper dealing with images.
BUG=196769
Review URL: https://chromiumcodereview.appspot.com/12780024
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@191304 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/content/browser/web_contents/web_contents_impl.h b/content/browser/web_contents/web_contents_impl.h
index c9d64430..9dbf0a2 100644
--- a/content/browser/web_contents/web_contents_impl.h
+++ b/content/browser/web_contents/web_contents_impl.h
@@ -265,10 +265,10 @@
virtual void DidChooseColorInColorChooser(int color_chooser_id,
SkColor color) OVERRIDE;
virtual void DidEndColorChooser(int color_chooser_id) OVERRIDE;
- virtual int DownloadFavicon(const GURL& url,
- bool is_favicon,
- int image_size,
- const FaviconDownloadCallback& callback) OVERRIDE;
+ virtual int DownloadImage(const GURL& url,
+ bool is_favicon,
+ int image_size,
+ const ImageDownloadCallback& callback) OVERRIDE;
// Implementation of PageNavigator.
virtual WebContents* OpenURL(const OpenURLParams& params) OVERRIDE;
@@ -565,10 +565,10 @@
const GURL& url,
const base::FilePath& plugin_path);
void OnBrowserPluginMessage(const IPC::Message& message);
- void OnDidDownloadFavicon(int id,
- const GURL& image_url,
- int requested_size,
- const std::vector<SkBitmap>& bitmaps);
+ void OnDidDownloadImage(int id,
+ const GURL& image_url,
+ int requested_size,
+ const std::vector<SkBitmap>& bitmaps);
void OnUpdateFaviconURL(int32 page_id,
const std::vector<FaviconURL>& candidates);
void OnFrameDetached(int64 frame_id);
@@ -871,9 +871,9 @@
// Routing id of the shown fullscreen widget or MSG_ROUTING_NONE otherwise.
int fullscreen_widget_routing_id_;
- // Maps the ids of pending favicon downloads to their callbacks
- typedef std::map<int, FaviconDownloadCallback> FaviconDownloadMap;
- FaviconDownloadMap favicon_download_map_;
+ // Maps the ids of pending image downloads to their callbacks
+ typedef std::map<int, ImageDownloadCallback> ImageDownloadMap;
+ ImageDownloadMap image_download_map_;
DISALLOW_COPY_AND_ASSIGN(WebContentsImpl);
};