diff options
author | estade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-05-07 20:42:24 +0000 |
---|---|---|
committer | estade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-05-07 20:42:24 +0000 |
commit | 46728b1ff43220f8515deba08a60e079d193bf4c (patch) | |
tree | 0e1d2ccc770c132576c16acb245a0c5c277e835c /chrome/browser/icon_manager.cc | |
parent | 6b16d779369be1df91ab891e15f9a7e5fe7bce30 (diff) | |
download | chromium_src-46728b1ff43220f8515deba08a60e079d193bf4c.zip chromium_src-46728b1ff43220f8515deba08a60e079d193bf4c.tar.gz chromium_src-46728b1ff43220f8515deba08a60e079d193bf4c.tar.bz2 |
Windows icon loader refactor in preparation for port.
Review URL: http://codereview.chromium.org/115056
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@15577 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/icon_manager.cc')
-rw-r--r-- | chrome/browser/icon_manager.cc | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/chrome/browser/icon_manager.cc b/chrome/browser/icon_manager.cc index 4b0c21b..827e0b1 100644 --- a/chrome/browser/icon_manager.cc +++ b/chrome/browser/icon_manager.cc @@ -48,8 +48,8 @@ IconManager::Handle IconManager::LoadIcon( IconRequest* request = new IconRequest(callback); AddRequest(request, consumer); - IconLoader* loader = - IconLoader::CreateIconLoaderForFileResource(path, size, this); + IconLoader* loader = IconLoader::Create(path, size, this); + loader->AddRef(); loader->Start(); ClientRequest client_request = { request, path, size }; requests_[loader] = client_request; @@ -58,11 +58,12 @@ IconManager::Handle IconManager::LoadIcon( // IconLoader::Delegate implementation ----------------------------------------- -bool IconManager::OnSkBitmapLoaded(IconLoader* source, SkBitmap* result) { - scoped_ptr<IconLoader> scoped_source(source); +bool IconManager::OnBitmapLoaded(IconLoader* source, SkBitmap* result) { + ClientRequests::iterator rit = requests_.find(source); + // Balances the AddRef() in LoadIcon(). + source->Release(); // Look up our client state. - ClientRequests::iterator rit = requests_.find(source); if (rit == requests_.end()) { NOTREACHED(); return false; // Return false to indicate result should be deleted. |