summaryrefslogtreecommitdiffstats
path: root/chrome/browser/jumplist_win.cc
diff options
context:
space:
mode:
authorkaiwang@chromium.org <kaiwang@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-12-07 01:32:01 +0000
committerkaiwang@chromium.org <kaiwang@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-12-07 01:32:01 +0000
commit0ea3db50aa19bcc15dcf15fcf4e7b20be3b004fb (patch)
tree972c588c6b25ddbbcce41e50193c4346993f496e /chrome/browser/jumplist_win.cc
parent2494ceabbea6b78e7b5dda93717dcbcfbb1bc5a4 (diff)
downloadchromium_src-0ea3db50aa19bcc15dcf15fcf4e7b20be3b004fb.zip
chromium_src-0ea3db50aa19bcc15dcf15fcf4e7b20be3b004fb.tar.gz
chromium_src-0ea3db50aa19bcc15dcf15fcf4e7b20be3b004fb.tar.bz2
Convert some FaviconService functions to use New CancelableTaskTracker
This CL converts: FaviconService::GetFaviconImageForURL FaviconService::GetRawFaviconForURL FaviconService::GetFaviconForURL ---------- They depends on --------- HistoryService::GetFaviconsForURL ---------- which depends on -------- HistoryBackend::GetFaviconsForURL So please review above changes first. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ FaviconService::GetFaviconImageForURL ---------- is used by -------------- bookmarks/bookmark_model.cc ui/intents/web_intent_icon_loader.cc ui/cocoa/history_menu_bridge.mm ui/toolbar/recent_tabs_sub_menu_model.cc ui/toolbar/back_forward_menu_model.cc ui/webui/ntp/app_launcher_handler.cc jumplist_win.cc FaviconService::GetRawFaviconForURL ---------- is used by -------------- android/provider/chrome_browser_provider.cc bookmarks/bookmark_html_writer.cc sync/glue/session_model_associator.cc ui/webui/extensions/extension_icon_source.cc ui/webui/favicon_source.cc ui/webui/ntp/android/bookmarks_handler.cc ui/webui/ntp/favicon_webui_handler.cc FaviconService::GetFaviconForURL ---------- is used by -------------- favicon/favicon_handler.h BUG=155883 Review URL: https://chromiumcodereview.appspot.com/11421188 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@171675 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/jumplist_win.cc')
-rw-r--r--chrome/browser/jumplist_win.cc25
1 files changed, 13 insertions, 12 deletions
diff --git a/chrome/browser/jumplist_win.cc b/chrome/browser/jumplist_win.cc
index 25fa0bd..91c0120 100644
--- a/chrome/browser/jumplist_win.cc
+++ b/chrome/browser/jumplist_win.cc
@@ -488,7 +488,7 @@ bool UpdateJumpList(const wchar_t* app_id,
JumpList::JumpList()
: ALLOW_THIS_IN_INITIALIZER_LIST(weak_ptr_factory_(this)),
profile_(NULL),
- handle_(NULL) {
+ task_id_(CancelableTaskTracker::kBadTaskId) {
}
JumpList::~JumpList() {
@@ -575,11 +575,9 @@ void JumpList::RemoveObserver() {
}
void JumpList::CancelPendingUpdate() {
- if (handle_) {
- FaviconService* favicon_service = FaviconServiceFactory::GetForProfile(
- profile_, Profile::EXPLICIT_ACCESS);
- favicon_service->CancelRequest(handle_);
- handle_ = NULL;
+ if (task_id_ != CancelableTaskTracker::kBadTaskId) {
+ cancelable_task_tracker_.TryCancel(task_id_);
+ task_id_ = CancelableTaskTracker::kBadTaskId;
}
}
@@ -708,18 +706,21 @@ void JumpList::StartLoadingFavicon() {
}
FaviconService* favicon_service =
FaviconServiceFactory::GetForProfile(profile_, Profile::EXPLICIT_ACCESS);
- handle_ = favicon_service->GetFaviconImageForURL(
- FaviconService::FaviconForURLParams(profile_, url, history::FAVICON,
- gfx::kFaviconSize, &favicon_consumer_),
- base::Bind(&JumpList::OnFaviconDataAvailable, base::Unretained(this)));
+ task_id_ = favicon_service->GetFaviconImageForURL(
+ FaviconService::FaviconForURLParams(profile_,
+ url,
+ history::FAVICON,
+ gfx::kFaviconSize),
+ base::Bind(&JumpList::OnFaviconDataAvailable,
+ base::Unretained(this)),
+ &cancelable_task_tracker_);
}
void JumpList::OnFaviconDataAvailable(
- FaviconService::Handle handle,
const history::FaviconImageResult& image_result) {
// If there is currently a favicon request in progress, it is now outdated,
// as we have received another, so nullify the handle from the old request.
- handle_ = NULL;
+ task_id_ = CancelableTaskTracker::kBadTaskId;
// lock the list to set icon data and pop the url
{
base::AutoLock auto_lock(list_lock_);