| Index: content/browser/web_contents/web_contents_impl.cc
|
| diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
|
| index 5a41d12c4fa424cba6b3b865583ffb37ad671483..7dad533b74f03cb21f2c99f566e5c96d31374c1f 100644
|
| --- a/content/browser/web_contents/web_contents_impl.cc
|
| +++ b/content/browser/web_contents/web_contents_impl.cc
|
| @@ -59,7 +59,6 @@
|
| #include "content/common/browser_plugin/browser_plugin_constants.h"
|
| #include "content/common/browser_plugin/browser_plugin_messages.h"
|
| #include "content/common/frame_messages.h"
|
| -#include "content/common/image_messages.h"
|
| #include "content/common/input_messages.h"
|
| #include "content/common/ssl_status_serialization.h"
|
| #include "content/common/view_messages.h"
|
| @@ -132,21 +131,6 @@ const char kWebContentsAndroidKey[] = "web_contents_android";
|
| base::LazyInstance<std::vector<WebContentsImpl::CreatedCallback> >
|
| g_created_callbacks = LAZY_INSTANCE_INITIALIZER;
|
|
|
| -static int StartDownload(RenderFrameHost* rfh,
|
| - const GURL& url,
|
| - bool is_favicon,
|
| - uint32_t max_bitmap_size,
|
| - bool bypass_cache) {
|
| - static int g_next_image_download_id = 0;
|
| - rfh->Send(new ImageMsg_DownloadImage(rfh->GetRoutingID(),
|
| - ++g_next_image_download_id,
|
| - url,
|
| - is_favicon,
|
| - max_bitmap_size,
|
| - bypass_cache));
|
| - return g_next_image_download_id;
|
| -}
|
| -
|
| void NotifyCacheOnIO(
|
| scoped_refptr<net::URLRequestContextGetter> request_context,
|
| const GURL& url,
|
| @@ -552,7 +536,6 @@ bool WebContentsImpl::OnMessageReceived(RenderViewHost* render_view_host,
|
| OnBrowserPluginMessage(render_frame_host,
|
| message))
|
| #endif
|
| - IPC_MESSAGE_HANDLER(ImageHostMsg_DidDownloadImage, OnDidDownloadImage)
|
| IPC_MESSAGE_HANDLER(ViewHostMsg_UpdateFaviconURL, OnUpdateFaviconURL)
|
| IPC_MESSAGE_HANDLER(ViewHostMsg_ShowValidationMessage,
|
| OnShowValidationMessage)
|
| @@ -2483,9 +2466,8 @@ int WebContentsImpl::DownloadImage(const GURL& url,
|
| uint32_t max_bitmap_size,
|
| bool bypass_cache,
|
| const ImageDownloadCallback& callback) {
|
| - int id = StartDownload(GetMainFrame(), url, is_favicon, max_bitmap_size,
|
| - bypass_cache);
|
| - image_download_map_[id] = callback;
|
| + int id = GetMainFrame()->DownloadImage(url, is_favicon, max_bitmap_size,
|
| + bypass_cache, callback);
|
| return id;
|
| }
|
|
|
| @@ -3181,28 +3163,6 @@ void WebContentsImpl::OnBrowserPluginMessage(RenderFrameHost* render_frame_host,
|
| }
|
| #endif // defined(ENABLE_PLUGINS)
|
|
|
| -void WebContentsImpl::OnDidDownloadImage(
|
| - int id,
|
| - int http_status_code,
|
| - const GURL& image_url,
|
| - const std::vector<SkBitmap>& bitmaps,
|
| - const std::vector<gfx::Size>& original_bitmap_sizes) {
|
| - if (bitmaps.size() != original_bitmap_sizes.size())
|
| - return;
|
| -
|
| - ImageDownloadMap::iterator iter = image_download_map_.find(id);
|
| - if (iter == image_download_map_.end()) {
|
| - // Currently WebContents notifies us of ANY downloads so that it is
|
| - // possible to get here.
|
| - return;
|
| - }
|
| - if (!iter->second.is_null()) {
|
| - iter->second.Run(
|
| - id, http_status_code, image_url, bitmaps, original_bitmap_sizes);
|
| - }
|
| - image_download_map_.erase(id);
|
| -}
|
| -
|
| void WebContentsImpl::OnUpdateFaviconURL(
|
| const std::vector<FaviconURL>& candidates) {
|
| FOR_EACH_OBSERVER(WebContentsObserver, observers_,
|
|
|