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

Unified Diff: chrome/browser/extensions/api/downloads/downloads_api.cc

Issue 11441006: Convert IconManager to use new CancelableTaskTracker (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase and fix mac compiling Created 8 years 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
« no previous file with comments | « no previous file | chrome/browser/icon_manager.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/api/downloads/downloads_api.cc
diff --git a/chrome/browser/extensions/api/downloads/downloads_api.cc b/chrome/browser/extensions/api/downloads/downloads_api.cc
index 9ee1954712d33bd84591c6b7b6eedbf8b7b80e12..b9d24cf1c7a804112feb7ae8fee37a81e6cf5449 100644
--- a/chrome/browser/extensions/api/downloads/downloads_api.cc
+++ b/chrome/browser/extensions/api/downloads/downloads_api.cc
@@ -38,6 +38,7 @@
#include "chrome/browser/renderer_host/chrome_render_message_filter.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/webui/web_ui_util.h"
+#include "chrome/common/cancelable_task_tracker.h"
#include "chrome/common/chrome_notification_types.h"
#include "chrome/common/extensions/api/downloads.h"
#include "content/public/browser/download_interrupt_reasons.h"
@@ -228,9 +229,9 @@ class DownloadFileIconExtractorImpl : public DownloadFileIconExtractor {
IconLoader::IconSize icon_size,
IconURLCallback callback) OVERRIDE;
private:
- void OnIconLoadComplete(IconManager::Handle handle, gfx::Image* icon);
+ void OnIconLoadComplete(gfx::Image* icon);
- CancelableRequestConsumer cancelable_consumer_;
+ CancelableTaskTracker cancelable_task_tracker_;
IconURLCallback callback_;
};
@@ -244,16 +245,15 @@ bool DownloadFileIconExtractorImpl::ExtractIconURLForPath(
// request, in which case the associated icon may also have changed.
// Therefore, for the moment we always call LoadIcon instead of attempting
// a LookupIcon.
- im->LoadIcon(
- path, icon_size, &cancelable_consumer_,
- base::Bind(&DownloadFileIconExtractorImpl::OnIconLoadComplete,
- base::Unretained(this)));
+ im->LoadIcon(path,
+ icon_size,
+ base::Bind(&DownloadFileIconExtractorImpl::OnIconLoadComplete,
+ base::Unretained(this)),
+ &cancelable_task_tracker_);
return true;
}
-void DownloadFileIconExtractorImpl::OnIconLoadComplete(
- IconManager::Handle handle,
- gfx::Image* icon) {
+void DownloadFileIconExtractorImpl::OnIconLoadComplete(gfx::Image* icon) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
std::string url;
if (icon)
« no previous file with comments | « no previous file | chrome/browser/icon_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698