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

Unified Diff: chrome/browser/extensions/image_loader.h

Issue 56833003: Use base::PostTaskAndReplyWithResults() in more places. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase, fix clang error Created 7 years, 1 month 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 | « chrome/browser/extensions/extension_protocols.cc ('k') | chrome/browser/extensions/image_loader.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/image_loader.h
diff --git a/chrome/browser/extensions/image_loader.h b/chrome/browser/extensions/image_loader.h
index 7365269fb62a2ad309fbf4864d7e35cf6a2dad24..2eeae20f03adfa8589eafb4cc408e00a75ebfec4 100644
--- a/chrome/browser/extensions/image_loader.h
+++ b/chrome/browser/extensions/image_loader.h
@@ -28,6 +28,8 @@ namespace extensions {
class Extension;
+typedef base::Callback<void(const gfx::Image&)> ImageLoaderCallback;
+
// This class is responsible for asynchronously loading extension images and
// calling a callback when an image is loaded.
// The views need to load their icons asynchronously might be deleted before
@@ -91,26 +93,22 @@ class ImageLoader : public BrowserContextKeyedService {
void LoadImageAsync(const extensions::Extension* extension,
const ExtensionResource& resource,
const gfx::Size& max_size,
- const base::Callback<void(const gfx::Image&)>& callback);
+ const ImageLoaderCallback& callback);
// Same as LoadImage() above except it loads multiple images from the same
// extension. This is used to load multiple resolutions of the same image
// type.
void LoadImagesAsync(const extensions::Extension* extension,
const std::vector<ImageRepresentation>& info_list,
- const base::Callback<void(const gfx::Image&)>& callback);
+ const ImageLoaderCallback& callback);
private:
- base::WeakPtrFactory<ImageLoader> weak_ptr_factory_;
+ void ReplyBack(const ImageLoaderCallback& callback,
+ const std::vector<LoadResult>& load_result);
- static void LoadImagesOnBlockingPool(
- const std::vector<ImageRepresentation>& info_list,
- const std::vector<SkBitmap>& bitmaps,
- std::vector<LoadResult>* load_result);
+ base::WeakPtrFactory<ImageLoader> weak_ptr_factory_;
- void ReplyBack(
- const std::vector<LoadResult>* load_result,
- const base::Callback<void(const gfx::Image&)>& callback);
+ DISALLOW_COPY_AND_ASSIGN(ImageLoader);
};
} // namespace extensions
« no previous file with comments | « chrome/browser/extensions/extension_protocols.cc ('k') | chrome/browser/extensions/image_loader.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698